added gholak

This commit is contained in:
2026-08-01 17:30:14 +03:30
parent 9642e603e7
commit eaff9dead2
12 changed files with 538 additions and 75 deletions
@@ -0,0 +1,34 @@
<?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('funds')) {
return;
}
Schema::table('funds', function (Blueprint $table) {
if (! Schema::hasColumn('funds', 'product_id')) {
$table->unsignedBigInteger('product_id')->nullable()->after('customer_id');
$table->index('product_id');
}
});
}
public function down(): void
{
if (! Schema::hasTable('funds') || ! Schema::hasColumn('funds', 'product_id')) {
return;
}
Schema::table('funds', function (Blueprint $table) {
$table->dropIndex(['product_id']);
$table->dropColumn('product_id');
});
}
};