Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('inventory_stocks', function (Blueprint $table) { |
||
17 | $table->bigIncrements('id'); |
||
18 | $table->unsignedBigInteger('warehouse_id'); |
||
19 | $table->unsignedBigInteger('product_sku_id'); |
||
20 | $table->integer('quantity')->default(0); |
||
21 | |||
22 | $table->string('aisle')->nullable(); |
||
23 | $table->string('row')->nullable(); |
||
24 | |||
25 | $table->timestamps(); |
||
26 | |||
27 | $table->foreign('product_sku_id') |
||
28 | ->references('id') |
||
29 | ->on('product_skus') |
||
30 | ->onDelete('cascade'); |
||
31 | |||
32 | $table->foreign('warehouse_id') |
||
33 | ->references('id') |
||
34 | ->on('warehouses') |
||
35 | ->onDelete('cascade'); |
||
36 | |||
37 | $table->unique(['product_sku_id', 'warehouse_id'], 'product_warehouse_key'); |
||
38 | }); |
||
51 |