Edit DB Anpassungen

main
Alex 2 years ago
parent dfb7d287d8
commit 3fb76004ba

@ -1,4 +1,4 @@
APP_NAME=Laravel APP_NAME=Rauru
APP_ENV=local APP_ENV=local
APP_KEY= APP_KEY=
APP_DEBUG=true APP_DEBUG=true
@ -8,12 +8,15 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug LOG_LEVEL=debug
DB_CONNECTION=mysql DB_CONNECTION=pgsql_rauru
DB_HOST=127.0.0.1 DB_HOST=db
DB_PORT=3306 DB_PORT=5432
DB_DATABASE=laravel DB_DATABASE=rauru_db
DB_USERNAME=root DB_USERNAME=rauru_user
DB_PASSWORD= DB_PASSWORD=secret
IGDB_CLIENT_ID="y4ezkipsb48y8sdj5aa00kwur2cr1w"
IGDB_ACCESS_TOKEN="oonmo0krok6dysrts70ftx3i8ki7zr"
BROADCAST_DRIVER=log BROADCAST_DRIVER=log
CACHE_DRIVER=file CACHE_DRIVER=file

@ -1,11 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Mod extends Model
{
use HasFactory;
}

@ -1,11 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Title extends Model
{
use HasFactory;
}

@ -63,6 +63,21 @@ return [
]) : [], ]) : [],
], ],
'pgsql_rauru' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
],
'pgsql' => [ 'pgsql' => [
'driver' => 'pgsql', 'driver' => 'pgsql',
'url' => env('DATABASE_URL'), 'url' => env('DATABASE_URL'),

@ -11,15 +11,21 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('users', function (Blueprint $table) { if (!Schema::connection('pgsql_rauru')->hasTable('users')) {
$table->id(); Schema::connection('pgsql_rauru')->create('users', function (Blueprint $table) {
$table->string('name'); $table->id();
$table->string('email')->unique(); $table->string('username');
$table->timestamp('email_verified_at')->nullable(); $table->string('firstname');
$table->string('password'); $table->string('lastname');
$table->rememberToken(); $table->string('email')->unique();
$table->timestamps(); $table->timestamp('email_verified_at')->nullable();
}); $table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
} }
/** /**
@ -27,6 +33,8 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('users'); if (Schema::connection('pgsql_rauru')->hasTable('users')) {
Schema::connection('pgsql_rauru')->dropIfExists('users');
}
} }
}; };

@ -11,11 +11,13 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('password_reset_tokens', function (Blueprint $table) { if (!Schema::connection('pgsql_rauru')->hasTable('password_reset_tokens')) {
$table->string('email')->primary(); Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('token'); $table->string('email')->primary();
$table->timestamp('created_at')->nullable(); $table->string('token');
}); $table->timestamp('created_at')->nullable();
});
}
} }
/** /**
@ -23,6 +25,8 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('password_reset_tokens'); if (Schema::connection('pgsql_rauru')->hasTable('password_reset_tokens')) {
Schema::connection('pgsql_rauru')->dropIfExists('password_reset_tokens');
}
} }
}; };

@ -11,15 +11,17 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('failed_jobs', function (Blueprint $table) { if (!Schema::connection('pgsql_rauru')->hasTable('failed_jobs')) {
$table->id(); Schema::connection('pgsql_rauru')->create('failed_jobs', function (Blueprint $table) {
$table->string('uuid')->unique(); $table->id();
$table->text('connection'); $table->string('uuid')->unique();
$table->text('queue'); $table->text('connection');
$table->longText('payload'); $table->text('queue');
$table->longText('exception'); $table->longText('payload');
$table->timestamp('failed_at')->useCurrent(); $table->longText('exception');
}); $table->timestamp('failed_at')->useCurrent();
});
}
} }
/** /**
@ -27,6 +29,8 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('failed_jobs'); if (Schema::connection('pgsql_rauru')->hasTable('failed_jobs')) {
Schema::connection('pgsql_rauru')->dropIfExists('failed_jobs');
}
} }
}; };

@ -11,16 +11,18 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('personal_access_tokens', function (Blueprint $table) { if (!Schema::connection('pgsql_rauru')->hasTable('personal_access_tokens')) {
$table->id(); Schema::connection('pgsql_rauru')->create('personal_access_tokens', function (Blueprint $table) {
$table->morphs('tokenable'); $table->id();
$table->string('name'); $table->morphs('tokenable');
$table->string('token', 64)->unique(); $table->string('name');
$table->text('abilities')->nullable(); $table->string('token', 64)->unique();
$table->timestamp('last_used_at')->nullable(); $table->text('abilities')->nullable();
$table->timestamp('expires_at')->nullable(); $table->timestamp('last_used_at')->nullable();
$table->timestamps(); $table->timestamp('expires_at')->nullable();
}); $table->timestamps();
});
}
} }
/** /**
@ -28,6 +30,8 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('personal_access_tokens'); if (Schema::connection('pgsql_rauru')->hasTable('personal_access_tokens')) {
Schema::connection('pgsql_rauru')->dropIfExists('personal_access_tokens');
}
} }
}; };

@ -11,67 +11,69 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('games', function (Blueprint $table) { if (!Schema::connection('pgsql_rauru')->hasTable('games')) {
$table->increments('id'); Schema::connection('pgsql_rauru')->create('games', function (Blueprint $table) {
$table->json('age_ratings'); $table->increments('id');
$table->string('aggregated_rating'); $table->json('age_ratings');
$table->integer('aggregated_rating_count'); $table->string('aggregated_rating');
$table->json('alternative_names'); $table->integer('aggregated_rating_count');
$table->json('artworks'); $table->json('alternative_names');
//$table->json('bundles'); $table->json('artworks');
$table->integer('category');//enum //$table->json('bundles');
$table->uuid('checksum'); $table->integer('category');//enum
$table->string('collection'); $table->uuid('checksum');
$table->string('cover_id'); $table->string('collection');
$table->string('cover_image_path'); $table->string('cover_id');
$table->json('dlcs'); $table->string('cover_image_path');
//$table->json('expanded_games'); $table->json('dlcs');
$table->json('expansions'); //$table->json('expanded_games');
$table->json('external_games');//IDs on other Platforms $table->json('expansions');
$table->date('first_release_date'); $table->json('external_games');//IDs on other Platforms
//$table->integer('follows'); $table->date('first_release_date');
//$table->json('forks'); //$table->integer('follows');
$table->string('franchise'); //$table->json('forks');
$table->json('franchises'); $table->string('franchise');
$table->json('game_engines'); $table->json('franchises');
$table->json('game_localizations'); $table->json('game_engines');
$table->json('game_modes'); $table->json('game_localizations');
$table->json('genres'); $table->json('game_modes');
//$table->integer('hypes'); $table->json('genres');
$table->json('involved_companies'); //$table->integer('hypes');
$table->json('keywords'); $table->json('involved_companies');
$table->json('language_supports'); $table->json('keywords');
$table->json('multiplayer_modes'); $table->json('language_supports');
$table->string('name'); $table->json('multiplayer_modes');
$table->string('parent_game'); $table->string('name');
$table->json('platforms'); $table->string('parent_game');
$table->json('player_perspectives'); $table->json('platforms');
$table->json('ports'); $table->json('player_perspectives');
$table->string('rating');//formated double $table->json('ports');
//$table->integer('rating_count'); $table->string('rating');//formated double
$table->json('release_dates'); //$table->integer('rating_count');
$table->json('remakes'); $table->json('release_dates');
$table->json('remasters'); $table->json('remakes');
$table->json('screenshots'); $table->json('remasters');
$table->json('similar_games'); $table->json('screenshots');
$table->string('slug'); $table->json('similar_games');
$table->json('standalone_expansions'); $table->string('slug');
$table->integer('status');//enum $table->json('standalone_expansions');
$table->text('storyline'); $table->integer('status');//enum
$table->text('summary'); $table->text('storyline');
$table->json('tags'); $table->text('summary');
$table->json('themes'); $table->json('tags');
$table->string('total_rating');//formated double $table->json('themes');
//$table->integer('total_rating_count'); $table->string('total_rating');//formated double
//$table->date('updated_at'); //$table->integer('total_rating_count');
$table->string('url');//IGDB Url //$table->date('updated_at');
$table->string('version_parent'); $table->string('url');//IGDB Url
$table->string('version_title'); $table->string('version_parent');
$table->json('videos'); $table->string('version_title');
$table->json('websites'); $table->json('videos');
$table->json('websites');
$table->timestamps(); $table->timestamps();
}); });
}
} }
/** /**
@ -79,6 +81,8 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('games'); if (Schema::connection('pgsql_rauru')->hasTable('games')) {
Schema::connection('pgsql_rauru')->dropIfExists('games');
}
} }
}; };

@ -11,10 +11,12 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('mods', function (Blueprint $table) { if (!Schema::connection('pgsql_rauru')->hasTable('mods')) {
$table->id(); Schema::connection('pgsql_rauru')->create('mods', function (Blueprint $table) {
$table->timestamps(); $table->id();
}); $table->timestamps();
});
}
} }
/** /**
@ -22,6 +24,8 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('mods'); if (Schema::connection('pgsql_rauru')->hasTable('mods')) {
Schema::connection('pgsql_rauru')->dropIfExists('mods');
}
} }
}; };

@ -11,10 +11,12 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
Schema::create('modpacks', function (Blueprint $table) { if (!Schema::connection('pgsql_rauru')->hasTable('modpacks')) {
$table->id(); Schema::connection('pgsql_rauru')->create('modpacks', function (Blueprint $table) {
$table->timestamps(); $table->id();
}); $table->timestamps();
});
}
} }
/** /**
@ -22,6 +24,8 @@ return new class extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::dropIfExists('modpacks'); if (Schema::connection('pgsql_rauru')->hasTable('modpacks')) {
Schema::connection('pgsql_rauru')->dropIfExists('modpacks');
}
} }
}; };

Loading…
Cancel
Save