fix kashkool

This commit is contained in:
2026-06-30 21:44:39 +03:30
parent 4a697af4c7
commit cd81ea8af0
9 changed files with 130 additions and 86 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('const') || Schema::hasColumn('const', 'value_json')) {
return;
}
Schema::table('const', function (Blueprint $table) {
if (Schema::hasColumn('const', 'value')) {
$table->json('value_json')->nullable()->after('value');
} else {
$table->json('value_json')->nullable();
}
});
}
public function down(): void
{
if (! Schema::hasTable('const') || ! Schema::hasColumn('const', 'value_json')) {
return;
}
Schema::table('const', function (Blueprint $table) {
$table->dropColumn('value_json');
});
}
};