Created
July 2, 2014 19:08
-
-
Save plainprogrammer/c7c56b0319e82b5972b0 to your computer and use it in GitHub Desktop.
failover.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :failover do | |
desc 'Roll failover back to primary database configuration' | |
task :primary do | |
File.delete('config/database.yml') | |
symlink('database.primary.yml', 'config/database.yml') | |
end | |
end | |
desc 'Failover to secondary database configuration' | |
task :failover do | |
File.delete('config/database.yml') | |
symlink('database.secondary.yml', 'config/database.yml') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment