Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class CreateOrderProducts extends Migration |
||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('product_order', function (Blueprint $table) { |
||
17 | $table->id(); |
||
18 | $table->unsignedBigInteger('order_id'); |
||
19 | $table->unsignedBigInteger('product_item_id'); |
||
20 | $table->integer('number_products'); |
||
21 | $table->timestamps(); |
||
22 | |||
23 | //fk |
||
24 | $table->foreign('order_id')->references('id')->on('orders'); |
||
25 | $table->foreign('product_item_id')->references('id')->on('product_items'); |
||
26 | }); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Reverse the migrations. |
||
31 | * |
||
32 | * @return void |
||
33 | */ |
||
34 | public function down() |
||
37 | } |
||
38 | } |
||
39 |