<?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 CreateWxCouponInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_coupon_info', function (Blueprint $table) {
            $table->increments('id');
            $table->string('appid')->comment('appid')->default(0);
            $table->integer('number')->comment('发放总量');
            $table->unsignedInteger('type_id')->comment('适用范围');
            $table->string('name', 255)->comment('优惠券名称');
            $table->string('condition', 255)->comment('使用条件');
            $table->unsignedInteger('money')->comment('最低消费');
            $table->unsignedInteger('coin')->nullable()->comment('价值');
            $table->unsignedInteger('rate')->nullable()->default(100)->comment('折扣率');
            $table->unsignedInteger('status')->default(1)->comment('状态');
            $table->unsignedInteger('way_id')->default(1)->comment('优惠方式');
            $table->dateTime('start_time')->comment('有效期开始时间');
            $table->dateTime('end_time')->comment('结束时间');
            $table->nullableTimestamps();
            $table->softDeletes();

            

            

        });
    }

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