Commit d19e3065 authored by pbair's avatar pbair

Fix table error from BG migration rake task

Fix a hook into `db:migrate` which tries to run outstanding batched
background migrations in development, but fails if we rollback the
schema to a point before the `batched_background_migrations` table
exists.
parent 8fe210bd
......@@ -243,7 +243,9 @@ namespace :gitlab do
# Only for development environments,
# we execute pending data migrations inline for convenience.
Rake::Task['db:migrate'].enhance do
Rake::Task['gitlab:db:execute_batched_migrations'].invoke if Rails.env.development?
if Rails.env.development? && Gitlab::Database::BackgroundMigration::BatchedMigration.table_exists?
Rake::Task['gitlab:db:execute_batched_migrations'].invoke
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment