<?php

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

/**
 * Migration auto-generated by Sequel Pro Laravel Export
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
 */
class CreateS1GoodsInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('s1_goods_info', function (Blueprint $table) {
            $table->increments('id');
            $table->string('appid')->comment('app_id')->default(0);
            $table->integer('cate_id')->comment('分类ID')->default(0);
            $table->integer('is_home_cate')->comment('分类ID');
            $table->integer('home_cate_id')->comment('首页分类ID')->default(0);
            $table->integer('attr_id')->comment('属性ID')->default(0);
            $table->string('name', 255)->comment('商品名称');
            $table->string('number', 255)->comment('商品编号');
            $table->string('pic', 255)->nullable()->comment('商品封面图片');
            $table->integer('weight')->comment('商品重量(克)');
            $table->integer('stock')->comment('库存');
            $table->integer('status')->default(1)->comment('商品状态上下架');
            $table->integer('market_price')->comment('市场价');
            $table->integer('price')->comment('销售价');
            $table->integer('cost_price')->comment('成本价');
            $table->integer('junior_price')->comment('初级会员价');
            $table->integer('middle_price')->comment('中级会员价');
            $table->integer('top_price')->comment('高级会员价');
            $table->integer('sale_number')->comment('已售数量');
            $table->text('info')->nullable()->comment('商品简介');
            $table->integer('is_address')->default(1)->comment('是否需要收货地址');
            $table->integer('sort')->comment('排序');
            $table->timestamp('ground_time')->default(\DB::raw('CURRENT_TIMESTAMP'))->comment('上架时间');
            $table->timestamp('draw_time')->default('0000-00-00 00:00:00')->comment('下架时间');
            $table->nullableTimestamps();
            $table->softDeletes();

            $table->index('cate_id', 's1_goods_info_cate_id_foreign');

            

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('s1_goods_info');
    }
}
