mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
fix migration down database integrity contraints
This commit is contained in:
@@ -29,7 +29,7 @@ class CreateUsersTable extends Migration
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
{
|
||||
Schema::drop('users');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,6 @@ class CreateRatesTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::dropIfExists('rates');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,14 @@ class CreateBookingsTable extends Migration
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
{
|
||||
Schema::table('bookings', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('bookings_rate_id_foreign');
|
||||
$table->dropColumn('rate_id');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('bookings');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ class ChangeUserIdInBookingsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
Schema::table('bookings', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('bookings_user_id_foreign');
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,7 @@ class AddBookingsTable extends Migration
|
||||
$table->string('usd_book_swift_code')->default(' ');
|
||||
$table->string('usd_book_cnap')->default(' ');
|
||||
$table->string('usd_book_bank_branch')->default(' ');
|
||||
$table->boolean('verification_status')->default('1'); // Results in a default value of 1.
|
||||
|
||||
// $table->foreign('status_id')
|
||||
// ->references('id')->on('status')
|
||||
// ->onDelete('cascade');
|
||||
$table->boolean('verification_status')->default('1');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -43,8 +39,6 @@ class AddBookingsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,7 @@ class MakeNullableFieldBookingsTable extends Migration
|
||||
$table->string('usd_book_swift_code')->nullable()->change();
|
||||
$table->string('usd_book_cnap')->nullable()->change();
|
||||
$table->string('usd_book_bank_branch')->nullable()->change();
|
||||
$table->boolean('verification_status')->nullable()->change(); // Results in a default value of 1.
|
||||
|
||||
// $table->foreign('status_id')
|
||||
// ->references('id')->on('status')
|
||||
// ->onDelete('cascade');
|
||||
$table->boolean('verification_status')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,11 @@ class CreateUserBankSlipsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('user_bank_slips', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('user_bank_slips_book_id_foreign');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('user_bank_slips');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,11 @@ class CreatePurchaseOrdersTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('purchase_orders', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('purchase_orders_booking_id_foreign');
|
||||
$table->dropColumn('booking_id');
|
||||
});
|
||||
Schema::dropIfExists('purchase_orders');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ class CreateMarkingTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('marking');
|
||||
Schema::dropIfExists('markings');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,12 @@ class CreateInvoiceTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('invoices', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('invoices_booking_id_foreign');
|
||||
$table->dropColumn('booking_id');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('invoices');
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -27,6 +27,10 @@ class AddBookingidForeignkeyToChinabankslipTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('china_bank_slips', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('china_bank_slips_booking_id_foreign');
|
||||
$table->dropColumn('booking_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user