merge product controller with kashkool
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddProviderFieldsToOrdersTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasColumn('orders', 'provider_id')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('provider_id')
|
||||
->nullable()
|
||||
->after('id')
|
||||
->index();
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('orders', 'total_price_montzar')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->decimal('total_price_montzar', 20, 4)
|
||||
->nullable()
|
||||
->after('total_price');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
if (Schema::hasColumn('orders', 'total_price_montzar')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->dropColumn('total_price_montzar');
|
||||
});
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('orders', 'provider_id')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->dropIndex(['provider_id']);
|
||||
$table->dropColumn('provider_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user