<?php

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

class AddAttributeToGoodsSkus extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasColumn('goods_skus', "attribute")) {
            return;
        }
        Schema::table('goods_skus', function (Blueprint $table) {

            $table->string('attribute',100)->default("")->comment('属性名称');

        });
    }

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