mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user