
PK 
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePromocodeusesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('promocodeuses', function (Blueprint $table) {
$table->increments('id')->unsigned();
$table->integer('user_id')->unsigned()->default(0);
$table->integer('promo_id')->unsigned()->default(0);
$table->string('promo_name', 150);
$table->string('promo_code', 150);
$table->tinyInteger('promo_type')->unsigned()->default(1)->comment('1:%discount;2:flatdiscount');
$table->double('promo_amount', 8, 2);
$table->tinyInteger('isactive')->unsigned()->default(1)->comment('0:inactive;1:active');
$table->tinyInteger('isdelete')->unsigned()->default(1)->comment('0:isdelete;1:active');
$table->timestamps();
$table->softDeletes();
$table->ipAddress('visitor');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('promocodeuses');
}
}


PK 99