Total Complexity | 2 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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->foreign('book_id') |
||
17 | ->references('id') |
||
18 | ->on('books') |
||
19 | ->onUpdate('CASCADE') |
||
20 | ->onDelete('CASCADE'); |
||
21 | $table->foreign('store_id') |
||
22 | ->references('id') |
||
23 | ->on('stores') |
||
24 | ->onUpdate('CASCADE') |
||
25 | ->onDelete('CASCADE'); |
||
26 | }); |
||
27 | } |
||
28 | |||
29 | public function down() |
||
30 | { |
||
31 | // |
||
34 |