<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddIsSyncDisableToProductsTable extends Migration
{
    public function up()
    {
        if (!Schema::hasColumn('products', 'is_sync_disable')) {
            Schema::table('products', function (Blueprint $table) {
                $table->boolean('is_sync_disable')->nullable()->after('is_imei');
            });
        }
    }

    public function down()
    {
        if (Schema::hasColumn('products', 'is_sync_disable')) {
            Schema::table('products', function (Blueprint $table) {
                $table->dropColumn('is_sync_disable');
            });
        }
    }
}
