osb/database/migrations/2017_06_18_104531_create_ab_discount_table.php
2018-06-18 21:18:34 +10:00

57 lines
1.6 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateAbDiscountTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ab_discount', function(Blueprint $table)
{
$table->bigInteger('id')->nullable();
$table->integer('site_id')->nullable();
$table->bigInteger('date_orig')->nullable();
$table->boolean('active')->nullable()->index('status');
$table->bigInteger('date_start')->nullable()->index('start');
$table->bigInteger('date_expire')->nullable()->index('expire');
$table->string('name', 64)->nullable();
$table->text('notes')->nullable();
$table->integer('max_usage_account')->nullable();
$table->integer('max_usage_global')->nullable();
$table->bigInteger('avail_account_id')->nullable();
$table->text('avail_product_id')->nullable();
$table->text('avail_group_id')->nullable();
$table->text('avail_tld_id')->nullable();
$table->boolean('new_status')->nullable();
$table->boolean('new_type')->nullable();
$table->float('new_rate', 10, 0)->nullable();
$table->float('new_max_discount', 10, 0)->nullable();
$table->float('new_min_cost', 10, 0)->nullable();
$table->boolean('recurr_status')->nullable();
$table->boolean('recurr_type')->nullable();
$table->float('recurr_rate', 10, 0)->nullable();
$table->float('recurr_max_discount', 10, 0)->nullable();
$table->float('recurr_min_cost', 10, 0)->nullable();
$table->unique(['site_id','id'], 'IDS');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ab_discount');
}
}