update migration

This commit is contained in:
Jack Goh
2018-08-02 10:54:49 +08:00
parent 6815828b60
commit 1455fb28d7
2 changed files with 2 additions and 2 deletions
@@ -17,7 +17,7 @@ class CreatePurchaseOrdersTable extends Migration
$table->increments('id');
$table->string('image_url');
$table->double('amount');
$table->integer('book_id')->unsigned();
$table->integer('book_id')->unsigned()->nullable;
$table->foreign('book_id')->references('id')->on('bookings');
$table->timestamps();
});
@@ -17,7 +17,7 @@ class RenameBookingForeignkeyInPoTable extends Migration
{
$table->dropForeign(['book_id']);
$table->dropColumn('book_id');
$table->integer('booking_id')->unsigned();
$table->integer('booking_id')->unsigned()->nullable();
$table->foreign('booking_id')->references('id')->on('bookings');
});
}