From c4b76bf48e05a2d0f0bb7ee687644ee7e518cbe1 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 2 Feb 2017 18:25:11 -0500 Subject: [PATCH] Remove FKs correctly --- .../2017_02_02_175548_UpdateColumnNames.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/database/migrations/2017_02_02_175548_UpdateColumnNames.php b/database/migrations/2017_02_02_175548_UpdateColumnNames.php index bc49c7d45..7e281af8e 100644 --- a/database/migrations/2017_02_02_175548_UpdateColumnNames.php +++ b/database/migrations/2017_02_02_175548_UpdateColumnNames.php @@ -49,6 +49,18 @@ class UpdateColumnNames extends Migration public function down() { Schema::table('servers', function (Blueprint $table) { + $table->dropForeign('servers_node_id_foreign'); + $table->dropForeign('servers_owner_id_foreign'); + $table->dropForeign('servers_allocation_id_foreign'); + $table->dropForeign('servers_service_id_foreign'); + $table->dropForeign('servers_option_id_foreign'); + + $table->dropIndex('servers_node_id_foreign'); + $table->dropIndex('servers_owner_id_foreign'); + $table->dropIndex('servers_allocation_id_foreign'); + $table->dropIndex('servers_service_id_foreign'); + $table->dropIndex('servers_option_id_foreign'); + $table->renameColumn('node_id', 'node'); $table->renameColumn('owner_id', 'owner'); $table->renameColumn('allocation_id', 'allocation');