1
0

0_post_deployment_migrations.rb 674 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. # Post deployment migrations are included by default. This file must be loaded
  3. # before other initializers as Rails may otherwise memoize a list of migrations
  4. # excluding the post deployment migrations.
  5. unless ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS']
  6. Rails.application.config.paths['db'].each do |db_path|
  7. path = Rails.root.join(db_path, 'post_migrate').to_s
  8. Rails.application.config.paths['db/migrate'] << path
  9. # Rails memoizes migrations at certain points where it won't read the above
  10. # path just yet. As such we must also update the following list of paths.
  11. ActiveRecord::Migrator.migrations_paths << path
  12. end
  13. end