Total Complexity | 2 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class CreateDatastoreDatastoreTable extends Migration |
||
12 | { |
||
13 | /** |
||
14 | * Run the migrations. |
||
15 | * |
||
16 | * @return void |
||
17 | */ |
||
18 | public function up() |
||
19 | { |
||
20 | Schema::create('datastore_datastore', function (Blueprint $table) { |
||
21 | $table->bigIncrements('id'); |
||
22 | $table->unsignedBigInteger('datastore_id')->nullable(); |
||
23 | $table->unsignedBigInteger('datastore2_id')->nullable(); |
||
24 | |||
25 | $table->unique(['datastore2_id', 'datastore_id']); |
||
26 | $table->index('datastore_id'); |
||
27 | $table->index('datastore2_id'); |
||
28 | |||
29 | |||
30 | $table->foreign('datastore_id')->references('id')->on('datastore')->onDelete('CASCADE')->onUpdate('RESTRICT'); |
||
31 | $table->foreign('datastore2_id')->references('id')->on('datastore')->onDelete('CASCADE')->onUpdate('RESTRICT'); |
||
32 | |||
33 | |||
34 | |||
35 | }); |
||
36 | |||
37 | |||
38 | |||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Reverse the migrations. |
||
43 | * |
||
44 | * @return void |
||
45 | */ |
||
46 | public function down() |
||
49 | } |
||
50 | } |
||
51 |