2016-01-06 07:51:31 +00:00
|
|
|
<?php namespace Database\Tester\Updates;
|
|
|
|
|
|
|
|
|
|
use Schema;
|
|
|
|
|
use October\Rain\Database\Updates\Migration;
|
|
|
|
|
|
|
|
|
|
class CreateRolesTable extends Migration
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public function up()
|
|
|
|
|
{
|
2019-07-18 14:50:37 +00:00
|
|
|
Schema::create('database_tester_roles', function ($table) {
|
2016-01-06 07:51:31 +00:00
|
|
|
$table->engine = 'InnoDB';
|
|
|
|
|
$table->increments('id');
|
|
|
|
|
$table->string('name')->nullable();
|
|
|
|
|
$table->text('description')->nullable();
|
|
|
|
|
$table->timestamps();
|
|
|
|
|
});
|
|
|
|
|
|
2019-07-18 14:50:37 +00:00
|
|
|
Schema::create('database_tester_authors_roles', function ($table) {
|
2016-01-06 07:51:31 +00:00
|
|
|
$table->engine = 'InnoDB';
|
|
|
|
|
$table->integer('author_id')->unsigned();
|
|
|
|
|
$table->integer('role_id')->unsigned();
|
|
|
|
|
$table->primary(['author_id', 'role_id']);
|
|
|
|
|
$table->string('clearance_level')->nullable();
|
|
|
|
|
$table->boolean('is_executive')->default(false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('database_tester_roles');
|
|
|
|
|
Schema::dropIfExists('database_tester_authors_roles');
|
|
|
|
|
}
|
|
|
|
|
}
|