added tahesab options

This commit is contained in:
2026-06-25 22:20:40 +03:30
parent 936cc88e53
commit e6e1ff0cc4
11 changed files with 411 additions and 144 deletions
@@ -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);
}
}
});
}
};