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,9 +11,12 @@ 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')) {
Schema::connection('pgsql_rauru')->create('users', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name'); $table->string('username');
$table->string('firstname');
$table->string('lastname');
$table->string('email')->unique(); $table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('password'); $table->string('password');
@ -22,11 +25,16 @@ return new class extends Migration
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
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,18 +11,22 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
if (!Schema::connection('pgsql_rauru')->hasTable('password_reset_tokens')) {
Schema::create('password_reset_tokens', function (Blueprint $table) { Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary(); $table->string('email')->primary();
$table->string('token'); $table->string('token');
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
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,7 +11,8 @@ 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')) {
Schema::connection('pgsql_rauru')->create('failed_jobs', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->text('connection'); $table->text('connection');
@ -21,12 +22,15 @@ return new class extends Migration
$table->timestamp('failed_at')->useCurrent(); $table->timestamp('failed_at')->useCurrent();
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
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,7 +11,8 @@ 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')) {
Schema::connection('pgsql_rauru')->create('personal_access_tokens', function (Blueprint $table) {
$table->id(); $table->id();
$table->morphs('tokenable'); $table->morphs('tokenable');
$table->string('name'); $table->string('name');
@ -22,12 +23,15 @@ return new class extends Migration
$table->timestamps(); $table->timestamps();
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
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,7 +11,8 @@ 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')) {
Schema::connection('pgsql_rauru')->create('games', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->json('age_ratings'); $table->json('age_ratings');
$table->string('aggregated_rating'); $table->string('aggregated_rating');
@ -73,12 +74,15 @@ return new class extends Migration
$table->timestamps(); $table->timestamps();
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
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,17 +11,21 @@ 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')) {
Schema::connection('pgsql_rauru')->create('mods', function (Blueprint $table) {
$table->id(); $table->id();
$table->timestamps(); $table->timestamps();
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
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,17 +11,21 @@ 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')) {
Schema::connection('pgsql_rauru')->create('modpacks', function (Blueprint $table) {
$table->id(); $table->id();
$table->timestamps(); $table->timestamps();
}); });
} }
}
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
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