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_KEY=
APP_DEBUG=true
@ -8,12 +8,15 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
DB_CONNECTION=pgsql_rauru
DB_HOST=db
DB_PORT=5432
DB_DATABASE=rauru_db
DB_USERNAME=rauru_user
DB_PASSWORD=secret
IGDB_CLIENT_ID="y4ezkipsb48y8sdj5aa00kwur2cr1w"
IGDB_ACCESS_TOKEN="oonmo0krok6dysrts70ftx3i8ki7zr"
BROADCAST_DRIVER=log
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' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),

@ -11,15 +11,21 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
if (!Schema::connection('pgsql_rauru')->hasTable('users')) {
Schema::connection('pgsql_rauru')->create('users', function (Blueprint $table) {
$table->id();
$table->string('username');
$table->string('firstname');
$table->string('lastname');
$table->string('email')->unique();
$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
{
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
{
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
if (!Schema::connection('pgsql_rauru')->hasTable('password_reset_tokens')) {
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
}
/**
@ -23,6 +25,8 @@ return new class extends Migration
*/
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
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
if (!Schema::connection('pgsql_rauru')->hasTable('failed_jobs')) {
Schema::connection('pgsql_rauru')->create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
}
/**
@ -27,6 +29,8 @@ return new class extends Migration
*/
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
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
if (!Schema::connection('pgsql_rauru')->hasTable('personal_access_tokens')) {
Schema::connection('pgsql_rauru')->create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
});
}
}
/**
@ -28,6 +30,8 @@ return new class extends Migration
*/
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
{
Schema::create('games', function (Blueprint $table) {
$table->increments('id');
$table->json('age_ratings');
$table->string('aggregated_rating');
$table->integer('aggregated_rating_count');
$table->json('alternative_names');
$table->json('artworks');
//$table->json('bundles');
$table->integer('category');//enum
$table->uuid('checksum');
$table->string('collection');
$table->string('cover_id');
$table->string('cover_image_path');
$table->json('dlcs');
//$table->json('expanded_games');
$table->json('expansions');
$table->json('external_games');//IDs on other Platforms
$table->date('first_release_date');
//$table->integer('follows');
//$table->json('forks');
$table->string('franchise');
$table->json('franchises');
$table->json('game_engines');
$table->json('game_localizations');
$table->json('game_modes');
$table->json('genres');
//$table->integer('hypes');
$table->json('involved_companies');
$table->json('keywords');
$table->json('language_supports');
$table->json('multiplayer_modes');
$table->string('name');
$table->string('parent_game');
$table->json('platforms');
$table->json('player_perspectives');
$table->json('ports');
$table->string('rating');//formated double
//$table->integer('rating_count');
$table->json('release_dates');
$table->json('remakes');
$table->json('remasters');
$table->json('screenshots');
$table->json('similar_games');
$table->string('slug');
$table->json('standalone_expansions');
$table->integer('status');//enum
$table->text('storyline');
$table->text('summary');
$table->json('tags');
$table->json('themes');
$table->string('total_rating');//formated double
//$table->integer('total_rating_count');
//$table->date('updated_at');
$table->string('url');//IGDB Url
$table->string('version_parent');
$table->string('version_title');
$table->json('videos');
$table->json('websites');
if (!Schema::connection('pgsql_rauru')->hasTable('games')) {
Schema::connection('pgsql_rauru')->create('games', function (Blueprint $table) {
$table->increments('id');
$table->json('age_ratings');
$table->string('aggregated_rating');
$table->integer('aggregated_rating_count');
$table->json('alternative_names');
$table->json('artworks');
//$table->json('bundles');
$table->integer('category');//enum
$table->uuid('checksum');
$table->string('collection');
$table->string('cover_id');
$table->string('cover_image_path');
$table->json('dlcs');
//$table->json('expanded_games');
$table->json('expansions');
$table->json('external_games');//IDs on other Platforms
$table->date('first_release_date');
//$table->integer('follows');
//$table->json('forks');
$table->string('franchise');
$table->json('franchises');
$table->json('game_engines');
$table->json('game_localizations');
$table->json('game_modes');
$table->json('genres');
//$table->integer('hypes');
$table->json('involved_companies');
$table->json('keywords');
$table->json('language_supports');
$table->json('multiplayer_modes');
$table->string('name');
$table->string('parent_game');
$table->json('platforms');
$table->json('player_perspectives');
$table->json('ports');
$table->string('rating');//formated double
//$table->integer('rating_count');
$table->json('release_dates');
$table->json('remakes');
$table->json('remasters');
$table->json('screenshots');
$table->json('similar_games');
$table->string('slug');
$table->json('standalone_expansions');
$table->integer('status');//enum
$table->text('storyline');
$table->text('summary');
$table->json('tags');
$table->json('themes');
$table->string('total_rating');//formated double
//$table->integer('total_rating_count');
//$table->date('updated_at');
$table->string('url');//IGDB Url
$table->string('version_parent');
$table->string('version_title');
$table->json('videos');
$table->json('websites');
$table->timestamps();
});
$table->timestamps();
});
}
}
/**
@ -79,6 +81,8 @@ return new class extends Migration
*/
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
{
Schema::create('mods', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
if (!Schema::connection('pgsql_rauru')->hasTable('mods')) {
Schema::connection('pgsql_rauru')->create('mods', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
}
/**
@ -22,6 +24,8 @@ return new class extends Migration
*/
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
{
Schema::create('modpacks', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
if (!Schema::connection('pgsql_rauru')->hasTable('modpacks')) {
Schema::connection('pgsql_rauru')->create('modpacks', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
}
/**
@ -22,6 +24,8 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('modpacks');
if (Schema::connection('pgsql_rauru')->hasTable('modpacks')) {
Schema::connection('pgsql_rauru')->dropIfExists('modpacks');
}
}
};

Loading…
Cancel
Save