fix bug in 22/4

This commit is contained in:
2026-07-13 13:31:44 +03:30
parent 82691cdf2c
commit 7eb4650b80
4 changed files with 145 additions and 0 deletions
@@ -0,0 +1,40 @@
<?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('products')) {
return;
}
Schema::table('products', function (Blueprint $table) {
if (! Schema::hasColumn('products', 'has_physical_delivery')) {
$table->boolean('has_physical_delivery')->default(false);
}
if (! Schema::hasColumn('products', 'min_physical_delivery_grams')) {
$table->decimal('min_physical_delivery_grams', 12, 3)->nullable();
}
});
}
public function down(): void
{
if (! Schema::hasTable('products')) {
return;
}
Schema::table('products', function (Blueprint $table) {
if (Schema::hasColumn('products', 'min_physical_delivery_grams')) {
$table->dropColumn('min_physical_delivery_grams');
}
if (Schema::hasColumn('products', 'has_physical_delivery')) {
$table->dropColumn('has_physical_delivery');
}
});
}
};