bigIncrements('id'); $table->string('no_po')->nullable(); $table->string('reference')->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('supplier_id')->unsigned(); // $table->foreign('supplier_id') // ->references('id') // ->on('suppliers') // ->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', 'received']); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('purchase_orders'); } }