<?php

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

class CreateCouponInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('coupon_info', function (Blueprint $table) {
            $table->increments('id');
            $table->string('type')->comment('优惠券类型：0：满减；1：折扣');
            $table->double('min_price')->comment('最低价格');

            $table->string('discount')->nullable()->comment('折扣');
            $table->string('discount_price')->nullable()->comment('优惠金额');
            $table->string('product_id',255)->comment('可使用的产品');
            $table->integer('count')->comment('数量');
            $table->date('end_time')->comment('有效期');

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

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