added percent in product price 3

This commit is contained in:
2026-07-04 22:14:18 +03:30
parent ed5bd74986
commit 3373bc82ca
4 changed files with 111 additions and 8 deletions
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
if (! Schema::hasTable('products')) {
return;
}
if (Schema::hasColumn('products', 'cash_fee_buy')) {
DB::statement('ALTER TABLE `products` MODIFY COLUMN `cash_fee_buy` DECIMAL(10,4) NULL DEFAULT NULL');
}
if (Schema::hasColumn('products', 'cash_fee_sell')) {
DB::statement('ALTER TABLE `products` MODIFY COLUMN `cash_fee_sell` DECIMAL(10,4) NULL DEFAULT NULL');
}
}
public function down(): void
{
if (! Schema::hasTable('products')) {
return;
}
if (Schema::hasColumn('products', 'cash_fee_buy')) {
DB::statement('ALTER TABLE `products` MODIFY COLUMN `cash_fee_buy` INT NULL DEFAULT NULL');
}
if (Schema::hasColumn('products', 'cash_fee_sell')) {
DB::statement('ALTER TABLE `products` MODIFY COLUMN `cash_fee_sell` INT NULL DEFAULT NULL');
}
}
};