bigIncrements('id'); $table->string('no_so')->nullable(); $table->date('transaction_date')->nullable(); $table->date('delivery_date')->nullable(); $table->bigInteger('chart_of_account_id')->unsigned()->nullable(); $table->foreign('chart_of_account_id') ->references('id') ->on('chart_of_accounts') ->onDelete('set null'); $table->bigInteger('postal_fee_account_id')->unsigned()->nullable(); $table->foreign('postal_fee_account_id') ->references('id') ->on('chart_of_accounts') ->onDelete('set null'); $table->string('postal_fee_price')->nullable(); $table->bigInteger('discount_account_id')->unsigned()->nullable(); $table->foreign('discount_account_id') ->references('id') ->on('chart_of_accounts') ->onDelete('set null'); $table->string('discount')->nullable(); $table->bigInteger('customer_id')->unsigned(); // $table->foreign('customer_id') // ->references('id') // ->on('customers') // ->onDelete('cascade'); $table->bigInteger('warehouse_id')->unsigned(); $table->foreign('warehouse_id') ->references('id') ->on('warehouses') ->onDelete('cascade'); $table->bigInteger('price_list_id')->unsigned()->nullable(); $table->foreign('price_list_id') ->references('id') ->on('price_lists') ->onDelete('set null'); $table->enum('status', ['draft', 'sent']); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('sale_orders'); } }