Fix bug with migrations after moving currency_id column that tried to drop a non-existing foreign key
MODIFY
database/migrations/2018_10_05_195046_add_overdue_foreign_keys.php
database/migrations/2018_10_05_195046_add_overdue_foreign_keys.php
@@ -6,10 +6,6 @@ use Illuminate\Database\Migrations\Migration;
class AddOverdueForeignKeys extends Migration {
public function up() {
- Schema::table('users', function ($table) {
- $table->foreign('currency_id')->references('id')->on('currencies');
- });
-
Schema::table('tags', function ($table) {
$table->foreign('space_id')->references('id')->on('spaces');
});
@@ -36,10 +32,6 @@ class AddOverdueForeignKeys extends Migration {
}
public function down() {
- Schema::table('users', function ($table) {
- $table->dropForeign('users_currency_id_foreign');
- });
-
Schema::table('tags', function ($table) {
$table->dropForeign('tags_space_id_foreign');
});

MODIFY
database/migrations/2018_11_23_161828_move_currency_id_column_to_spaces_table.php
database/migrations/2018_11_23_161828_move_currency_id_column_to_spaces_table.php
@@ -27,7 +27,6 @@ class MoveCurrencyIdColumnToSpacesTable extends Migration {
// Drop
Schema::table('users', function (Blueprint $table) {
- $table->dropForeign('users_currency_id_foreign');
$table->dropColumn('currency_id');
});
}

Fix bug with migrations after moving currency_id column that tried to drop a non-existing foreign key