Completed
Pull Request — master (#372)
by Mike
31:01 queued 16:07
created

CreateBookStore   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 22 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateBookStore extends Migration
7
{
8
    public function up()
9
    {
10
        Schema::create('book_store', function (Blueprint $table) {
11
            $table->increments('id');
12
            $table->unsignedInteger('book_id');
13
            $table->unsignedInteger('store_id');
14
            $table->timestamps();
15
16
            $table->string("test")->nullable();
17
18
            $table->foreign('book_id')
19
                ->references('id')
20
                ->on('books')
21
                ->onUpdate('CASCADE')
22
                ->onDelete('CASCADE');
23
            $table->foreign('store_id')
24
                ->references('id')
25
                ->on('stores')
26
                ->onUpdate('CASCADE')
27
                ->onDelete('CASCADE');
28
        });
29
    }
30
}
31