Fix behavior of database schema loading with SKIP_POST_DEPLOYMENT_MIGRATIONS
(#34089)
This commit is contained in:
parent
2bf5aee469
commit
04492e7f93
4 changed files with 62 additions and 11 deletions
|
@ -4,14 +4,4 @@
|
|||
# before other initializers as Rails may otherwise memoize a list of migrations
|
||||
# excluding the post deployment migrations.
|
||||
|
||||
unless ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS']
|
||||
Rails.application.config.paths['db'].each do |db_path|
|
||||
path = Rails.root.join(db_path, 'post_migrate').to_s
|
||||
|
||||
Rails.application.config.paths['db/migrate'] << path
|
||||
|
||||
# Rails memoizes migrations at certain points where it won't read the above
|
||||
# path just yet. As such we must also update the following list of paths.
|
||||
ActiveRecord::Migrator.migrations_paths << path
|
||||
end
|
||||
end
|
||||
Mastodon::Database.add_post_migrate_path_to_rails
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue