<?php

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

class RemoveColorFromAlbumProductAttr extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('album_product_attr', function (Blueprint $table) {
            $table->dropColumn(['category','type','color']);
            $table->string('name',255)->after('id')->comment('属性名字');
            $table->integer('pid')->after('name')->comment('父属性');
            $table->tinyInteger('attr_type')->after('pid')->comment('属性类型：0：品类；1：型号；2：颜色');
        });
    }

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