<?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 CreateS1CartInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('s1_cart_info', function (Blueprint $table) {
            $table->increments('id');
            $table->string('appid')->comment('app_id')->default(0);
            $table->integer('wx_user_id')->comment('用户id');
            $table->integer('s1_goods_id')->comment('商品id');
            $table->integer('goods_num')->comment('加入购物车数量')->default(1);
            $table->nullableTimestamps();
            $table->softDeletes();

            $table->index('wx_user_id', 's1_cart_info_wx_user_id_foreign');
            $table->index('s1_goods_id', 's1_cart_info_s1_goods_id_foreign');

        });
    }

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