<?php

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

class CreateUserCouponRelationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_coupon_relation', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('coupon_id')->comment('优惠券ID');
            $table->integer('user_id')->comment('用户ID');
            $table->tinyInteger('status')->default(0)->comment('是否使用：0：未使用;1:已使用');

            $table->softDeletes();
            $table->timestamps();
        });
    }

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