Remove FKs correctly

This commit is contained in:
Dane Everitt 2017-02-02 18:25:11 -05:00
parent d4bcf0be59
commit c4b76bf48e
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
1 changed files with 12 additions and 0 deletions

View File

@ -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');