feat: init postgresql database
This commit is contained in:
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
Schema::create('s3_storages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('name');
|
||||
$table->longText('description')->nullable();
|
||||
$table->string('region')->default('us-east-1');
|
||||
$table->longText('key');
|
||||
|
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('postgresqls', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
|
||||
$table->string('postgres_user')->default('postgres');
|
||||
$table->string('postgres_password');
|
||||
$table->string('postgres_db')->default('postgres');
|
||||
$table->string('postgres_initdb_args')->nullable();
|
||||
$table->string('postgres_host_auth_method')->nullable();
|
||||
$table->json('init_scripts')->nullable();
|
||||
|
||||
$table->timestamp('started_at')->nullable();
|
||||
$table->morphs('destination');
|
||||
|
||||
$table->foreignId('environment_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('postgresqls');
|
||||
}
|
||||
};
|
@@ -11,15 +11,8 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('databases', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->string('name');
|
||||
|
||||
$table->morphs('destination');
|
||||
|
||||
$table->foreignId('environment_id');
|
||||
$table->timestamps();
|
||||
Schema::table('applications', function (Blueprint $table) {
|
||||
$table->string('description')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,6 +21,8 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('databases');
|
||||
Schema::table('applications', function (Blueprint $table) {
|
||||
$table->dropColumn('description');
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user