lib/capistrano-extensions/recipes/db_sync.rb in capistrano-extensions-0.1.8 vs lib/capistrano-extensions/recipes/db_sync.rb in capistrano-extensions-0.1.9

- old
+ new

@@ -21,10 +21,11 @@ end upload(local_backup_file, "#{remote_file}.#{zip_ext}") pass_str = pluck_pass_str(db) run "#{unzip} -c #{remote_file}.#{zip_ext} > #{remote_file}" + run "cd #{current_path} && rake RAILS_ENV=#{rails_env} db:drop db:create" run "mysql -u#{db['username']} #{pass_str} #{db['database']} < #{remote_file}" run "rm -f #{remote_file}" end end @@ -88,9 +89,10 @@ #{mysql_dump} | #{zip} > #{local_backup_file}.#{zip_ext} && CMD end cmd << <<-CMD #{unzip} -c #{remote_backup_file}.#{zip_ext} > #{remote_backup_file} && + rake RAILS_ENV=#{env} db:drop db:create && #{mysql_str} < #{remote_backup_file} && rm -f #{remote_backup_file} CMD system(cmd.strip)