lib/capones_recipes/tasks/database/sync.rb in capones_recipes-1.5.0 vs lib/capones_recipes/tasks/database/sync.rb in capones_recipes-1.5.1
- old
+ new
@@ -62,11 +62,11 @@
# Download dump
download "#{shared_path}/sync/#{filename}", filename
# Local DB import
username, password, database, host = database_config('development')
- run_locally "rake db:reset"
+ run_locally "rake db:drop && rake db:create"
run_locally "bzip2 -d -c #{filename} | mysql -u #{username} --password='#{password}' #{database}"
run_locally "rm -f #{filename}"
logger.important "sync database from the stage '#{stage}' to local finished"
@@ -133,10 +133,10 @@
# Download dump
download "#{shared_path}/sync/#{filename}", filename
# Local DB import
username, password, database, host = database_config('development')
- run_locally "rake db:reset"
+ run_locally "rake db:drop && rake db:create"
run_locally "bzip2 -d -c #{filename} | mysql -u #{username} --password='#{password}' #{database}"
run_locally "rm -f #{filename}"
logger.important "sync database from the stage '#{stage}' to local finished"
end