Skip to content

Instantly share code, notes, and snippets.

@plainprogrammer
Created July 2, 2014 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plainprogrammer/c7c56b0319e82b5972b0 to your computer and use it in GitHub Desktop.
Save plainprogrammer/c7c56b0319e82b5972b0 to your computer and use it in GitHub Desktop.
failover.rake
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