diff --git a/database/migrations/2026_04_19_012052_add_process_status_to_transactions_table.php b/database/migrations/2026_04_19_012052_add_process_status_to_transactions_table.php index e4ba8a35..af19c5d2 100644 --- a/database/migrations/2026_04_19_012052_add_process_status_to_transactions_table.php +++ b/database/migrations/2026_04_19_012052_add_process_status_to_transactions_table.php @@ -12,13 +12,11 @@ return new class extends Migration public function up(): void { Schema::table('transactions', function (Blueprint $table) { - Schema::table('transactions', function (Blueprint $table) { - $table->unsignedTinyInteger('process_status') - ->nullable() - ->default(null) - ->after('status') - ->index(); - }); + $table->unsignedTinyInteger('process_status') + ->nullable() + ->default(null) + ->after('status') + ->index(); }); } @@ -28,9 +26,7 @@ return new class extends Migration public function down(): void { Schema::table('transactions', function (Blueprint $table) { - Schema::table('transactions', function (Blueprint $table) { - $table->dropColumn('process_status'); - }); + $table->dropColumn('process_status'); }); } }; diff --git a/database/migrations/2026_04_19_015052_add_process_status_to_transaction_logs_table.php b/database/migrations/2026_04_19_015052_add_process_status_to_transaction_logs_table.php index cfc0df68..0780837e 100644 --- a/database/migrations/2026_04_19_015052_add_process_status_to_transaction_logs_table.php +++ b/database/migrations/2026_04_19_015052_add_process_status_to_transaction_logs_table.php @@ -11,14 +11,16 @@ return new class extends Migration */ public function up(): void { + if (!Schema::hasTable('transaction_logs')) { + return; + } + Schema::table('transaction_logs', function (Blueprint $table) { - Schema::table('transaction_logs', function (Blueprint $table) { - $table->unsignedTinyInteger('process_status') - ->nullable() - ->default(null) - ->after('status') - ->index(); - }); + $table->unsignedTinyInteger('process_status') + ->nullable() + ->default(null) + ->after('status') + ->index(); }); } @@ -27,10 +29,12 @@ return new class extends Migration */ public function down(): void { + if (!Schema::hasTable('transaction_logs')) { + return; + } + Schema::table('transaction_logs', function (Blueprint $table) { - Schema::table('transaction_logs', function (Blueprint $table) { - $table->dropColumn('process_status'); - }); + $table->dropColumn('process_status'); }); } };