Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class CreateMinistryUsersTable extends Migration |
||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('fg_ministry_users', function (Blueprint $table) { |
||
17 | $table->string('id', 150)->primary(); |
||
18 | $table->string('ministry_id', 150)->index(); |
||
19 | $table->string('user_id', 150)->index(); |
||
20 | $table->boolean('active')->default(true); |
||
21 | $table->timestamps(); |
||
22 | |||
23 | $table->foreign('ministry_id')->references('id')->on('fg_ministries')->onDelete('cascade'); |
||
24 | $table->foreign('user_id')->references('id')->on('fg_users')->onDelete('cascade'); |
||
25 | }); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Reverse the migrations. |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | public function down() |
||
36 | } |
||
37 | } |
||
38 |