added percent in product price 3
This commit is contained in:
+38
@@ -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');
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user