bigInteger('sale_order_id')->unsigned(); $table->foreign('sale_order_id') ->references('id') ->on('sale_orders') ->onDelete('cascade'); $table->bigInteger('item_id')->unsigned(); $table->foreign('item_id') ->references('id') ->on('items') ->onDelete('cascade'); // $table->bigInteger('warehouse_id')->unsigned(); // $table->foreign('warehouse_id') // ->references('id') // ->on('warehouses') // ->onDelete('cascade'); $table->text('description')->nullable(); $table->string('rate'); $table->bigInteger('tax_id')->unsigned()->nullable(); $table->foreign('tax_id') ->references('id') ->on('taxes') ->onDelete('set null'); $table->string('tax_rate')->default(0); $table->double('qty')->default(0); $table->string('subtotal'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('item_sale_order'); } }