Skip to content

Commit dc2c7e8

Browse files
authored
Merge pull request #1359 from indentlabs/migration-configuration-flag
Add an environment variable that allows us to move from one database to another for migration
2 parents 8e62b78 + 8d3d3b2 commit dc2c7e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

config/application.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,12 @@ class Application < Rails::Application
3232
# the framework and any gems in your application.
3333

3434
config.active_job.queue_adapter = :sidekiq
35+
36+
config.after_initialize do
37+
if ENV["MIGRATION_DATABASE_URL"].present?
38+
puts "Connecting to migration database"
39+
ActiveRecord::Base.establish_connection(ENV["MIGRATION_DATABASE_URL"])
40+
end
41+
end
3542
end
3643
end

0 commit comments

Comments
 (0)