From 3539b9076cb9cfdd30f48dfbb4fcea7ab7e0f56d Mon Sep 17 00:00:00 2001 From: Jack Goh Date: Thu, 2 Aug 2018 11:02:59 +0800 Subject: [PATCH] update migration --- ...ame_booking_foreignkey_from_supplierbooking_table.php | 2 +- ...014020_add_billing_field_to_supplierbooking_table.php | 4 +++- ...14343_add_salestax_field_to_supplierbooking_table.php | 4 +++- .../2018_07_05_095441_add_marking_to_user_table.php | 9 ++++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/database/migrations/2018_07_02_104306_rename_booking_foreignkey_from_supplierbooking_table.php b/database/migrations/2018_07_02_104306_rename_booking_foreignkey_from_supplierbooking_table.php index f1a1dbd6..f3be6172 100644 --- a/database/migrations/2018_07_02_104306_rename_booking_foreignkey_from_supplierbooking_table.php +++ b/database/migrations/2018_07_02_104306_rename_booking_foreignkey_from_supplierbooking_table.php @@ -17,7 +17,7 @@ class RenameBookingForeignkeyFromSupplierbookingTable 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'); }); } diff --git a/database/migrations/2018_07_03_014020_add_billing_field_to_supplierbooking_table.php b/database/migrations/2018_07_03_014020_add_billing_field_to_supplierbooking_table.php index 15e2f5a2..59db1449 100644 --- a/database/migrations/2018_07_03_014020_add_billing_field_to_supplierbooking_table.php +++ b/database/migrations/2018_07_03_014020_add_billing_field_to_supplierbooking_table.php @@ -26,6 +26,8 @@ class AddBillingFieldToSupplierbookingTable extends Migration */ public function down() { - // + Schema::table('supplier_bookings', function (Blueprint $table) { + $table->dropColumn('billing_amount'); + }); } } diff --git a/database/migrations/2018_07_03_014343_add_salestax_field_to_supplierbooking_table.php b/database/migrations/2018_07_03_014343_add_salestax_field_to_supplierbooking_table.php index 63cafbdd..bfdc5283 100644 --- a/database/migrations/2018_07_03_014343_add_salestax_field_to_supplierbooking_table.php +++ b/database/migrations/2018_07_03_014343_add_salestax_field_to_supplierbooking_table.php @@ -26,6 +26,8 @@ class AddSalestaxFieldToSupplierbookingTable extends Migration */ public function down() { - // + Schema::table('supplier_bookings', function (Blueprint $table) { + $table->dropColumn('salestax_amount'); + }); } } diff --git a/database/migrations/2018_07_05_095441_add_marking_to_user_table.php b/database/migrations/2018_07_05_095441_add_marking_to_user_table.php index d8824ab7..20861381 100644 --- a/database/migrations/2018_07_05_095441_add_marking_to_user_table.php +++ b/database/migrations/2018_07_05_095441_add_marking_to_user_table.php @@ -15,7 +15,7 @@ class AddMarkingToUserTable extends Migration { Schema::table('users', function($table) { - $table->string('marking'); + $table->string('marking')->nullable(); }); } @@ -25,7 +25,10 @@ class AddMarkingToUserTable extends Migration * @return void */ public function down() - { - // + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('marking'); + }); + } }