<?php

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

class CreateWxUserCouponTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_user_coupon', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('wx_user_id')->comment('用户id');
            $table->unsignedInteger('wx_coupon_id')->comment('优惠券id');
            $table->unsignedTinyInteger('status')->default(0)->comment('是否使用');
            $table->timestamps();
            $table->softDeletes();
        });
    }

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