Remove superfluous conditional

A migration's `up` method is only run when the migration needs to be
applied. The only case we could have a higher version number is when a
migration with a higher version got merged before the current one. And
in that case, we still want this migration to fail, because it hasn't
been applied yet.
This commit is contained in:
Maikel Linke
2020-04-17 12:40:54 +10:00
parent 71c7c35679
commit 63ac6c5088

View File

@@ -1,11 +1,8 @@
class OldMigrationsRemoved < ActiveRecord::Migration
LAST_DELETED_MIGRATION = 20181128054803
def up
if ActiveRecord::Migrator.current_version < LAST_DELETED_MIGRATION
message = "You haven't updated your dev environment in a long time! " \
"Legacy migration files before 2019 have now been removed. " \
"Run `rails db:schema:load` before running `rails db:migrate`."
raise StandardError, message
end
message = "You haven't updated your dev environment in a long time! " \
"Legacy migration files before 2019 have now been removed. " \
"Run `rails db:schema:load` before running `rails db:migrate`."
raise StandardError, message
end
end