<?php

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

class CreateBusinessGoodsSkusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('business_goods_skus', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('shop_id');
            $table->bigInteger('self_sku_id')->nullable();
            $table->string('activity_no')->nullable();
            $table->string('category_name')->nullable();
            $table->bigInteger('create_time')->nullable();
            $table->text('goods_desc')->nullable();
            $table->string('goods_id')->nullable();
            $table->text('goods_image_list')->nullable();
            $table->string('goods_name')->nullable();
            $table->integer('is_activity_delete')->nullable();
            $table->integer('limit_buy')->nullable();
            $table->bigInteger('market_price')->nullable();
            $table->bigInteger('update_time')->nullable();
            $table->string('external_sku_id')->nullable();
            $table->bigInteger('goods_purchase_price')->nullable();
            $table->bigInteger('price_in_fen')->nullable();
            $table->bigInteger('quantity')->nullable();
            $table->integer('quantity_type')->nullable();
            $table->bigInteger('reserve_quantity')->nullable();
            $table->bigInteger('sku_id')->nullable();
            $table->bigInteger('sold_quantity')->nullable();
            $table->text('spec_list')->nullable();
            $table->string('spec_name')->nullable();
            $table->string('thumb_url')->nullable();
            $table->bigInteger('total_quantity')->nullable();
            $table->timestamps();
            $table->index(['shop_id', 'goods_id', 'sku_id']);
            $table->index(['shop_id', 'external_sku_id']);
        });
    }

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