added tahesab options
This commit is contained in:
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (! Schema::hasTable('tahesab')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('tahesab', function (Blueprint $table) {
|
||||
if (! Schema::hasColumn('tahesab', 'sync_status')) {
|
||||
$table->string('sync_status', 20)->default('pending')->after('type');
|
||||
}
|
||||
if (! Schema::hasColumn('tahesab', 'sync_log')) {
|
||||
$table->text('sync_log')->nullable()->after('sync_status');
|
||||
}
|
||||
if (! Schema::hasColumn('tahesab', 'withdraw_id')) {
|
||||
$table->unsignedBigInteger('withdraw_id')->nullable()->after('order_id');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if (! Schema::hasTable('tahesab')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('tahesab', function (Blueprint $table) {
|
||||
foreach (['sync_status', 'sync_log', 'withdraw_id'] as $column) {
|
||||
if (Schema::hasColumn('tahesab', $column)) {
|
||||
$table->dropColumn($column);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user