CreateDatastoreDatastoreTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 14 1
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
/**
8
 * Migration auto-generated by Sequel Pro Laravel Export (1.5.0)
9
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
10
 */
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()
47
    {
48
        Schema::dropIfExists('datastore_datastore');
49
    }
50
}
51