mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 05:15:35 +07:00
refactor: consolidate issuer_name into master migration (Clean Slate Principle)
This commit is contained in:
@@ -31,6 +31,7 @@ return new class extends Migration
|
||||
|
||||
$table->string('common_name')->nullable();
|
||||
$table->string('organization')->nullable();
|
||||
$table->string('issuer_name')->nullable();
|
||||
$table->dateTime('valid_from')->nullable();
|
||||
$table->dateTime('valid_to')->nullable();
|
||||
|
||||
@@ -62,6 +63,9 @@ return new class extends Migration
|
||||
if (!Schema::connection('mysql_ca')->hasColumn('ca_certificates', 'is_latest')) {
|
||||
$table->boolean('is_latest')->default(false)->after('last_synced_at');
|
||||
}
|
||||
if (!Schema::connection('mysql_ca')->hasColumn('ca_certificates', 'issuer_name')) {
|
||||
$table->string('issuer_name')->nullable()->after('organization');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?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::connection('mysql_ca')->table('ca_certificates', function (Blueprint $table) {
|
||||
$table->string('issuer_name')->nullable()->after('organization');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::connection('mysql_ca')->table('ca_certificates', function (Blueprint $table) {
|
||||
$table->dropColumn('issuer_name');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user