Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kiere/eycap into kiere-ma…
Browse files Browse the repository at this point in the history
…ster
  • Loading branch information
7hunderbird committed Apr 8, 2011
2 parents 07abd6f + 300af54 commit 2538ee4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/eycap/recipes/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
run("cat #{shared_path}/config/database.yml") { |channel, stream, data| @environment_info = YAML.load(data)[rails_env] }
dump

if @environment_info['adapter'] == 'mysql'
if ['mysql', 'mysql2'].include? @environment_info['adapter']
run "gunzip < #{backup_file}.gz | mysql -u #{dbuser} -p -h #{staging_dbhost} #{staging_database}" do |ch, stream, out|
ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
end
Expand All @@ -37,7 +37,7 @@
on_rollback { run "rm -f #{backup_file}" }
run("cat #{shared_path}/config/database.yml") { |channel, stream, data| @environment_info = YAML.load(data)[rails_env] }

if @environment_info['adapter'] == 'mysql'
if ['mysql', 'mysql2'].include? @environment_info['adapter']
dbhost = @environment_info['host']
if rails_env == "production"
dbhost = environment_dbhost.sub('-master', '') + '-replica' if dbhost != 'localhost' # added for Solo offering, which uses localhost
Expand Down

0 comments on commit 2538ee4

Please sign in to comment.