<?php

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

class AddFieldsWithBusinessGoodsSkusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasColumn('business_goods_skus', 'is_sync')) {
            return;
        }
        Schema::table('business_goods_skus', function (Blueprint $table) {
            $table->tinyInteger('is_sync')->default(1)->comment('是否同步');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('business_goods_skus', function (Blueprint $table) {
            $table->dropColumn('is_sync');
        });
    }
}
