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

43 lines
928 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateAbModuleTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ab_module', function(Blueprint $table)
{
$table->integer('id')->default(0);
$table->integer('site_id')->default(0)->index('fk_mod_set_idx');
$table->string('name', 128)->default('');
$table->bigInteger('date_orig')->nullable();
$table->boolean('active')->nullable();
$table->integer('parent_id')->nullable();
$table->text('notes')->nullable();
$table->boolean('external')->nullable();
$table->primary(['id','site_id']);
$table->unique(['site_id','name'], 'UNIQUE');
$table->index(['parent_id','site_id'], 'fk_mod_idx');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ab_module');
}
}