<?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 CreateS1UserFavoriteTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('s1_user_favorite', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('s1_goods_id')->comment('商品id');
            $table->integer('wx_user_id')->comment('用户id');
            $table->nullableTimestamps();

            $table->unique(['s1_goods_id', 'wx_user_id'], 's1_user_favorite_s1_goods_id_wx_user_id_unique');
            $table->index('wx_user_id', 's1_user_favorite_wx_user_id_foreign');

            

        });
    }

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