45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
|
||
|
class CreateAbAccountGroupTable extends Migration {
|
||
|
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('ab_account_group', function(Blueprint $table)
|
||
|
{
|
||
|
$table->bigInteger('id')->default(0);
|
||
|
$table->integer('site_id')->default(0);
|
||
|
$table->bigInteger('date_orig')->nullable();
|
||
|
$table->bigInteger('date_start')->nullable();
|
||
|
$table->bigInteger('date_expire')->nullable();
|
||
|
$table->integer('group_id')->default(0);
|
||
|
$table->bigInteger('account_id')->default(0);
|
||
|
$table->bigInteger('service_id')->nullable();
|
||
|
$table->boolean('active')->nullable();
|
||
|
$table->primary(['id','site_id','account_id','group_id']);
|
||
|
$table->unique(['site_id','group_id','account_id'], 'UNIQUE');
|
||
|
$table->index(['account_id','site_id'], 'fk_ag_acc_idx');
|
||
|
$table->index(['group_id','site_id'], 'fk_ag_grp_idx');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::drop('ab_account_group');
|
||
|
}
|
||
|
|
||
|
}
|