Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- desc "imports the data from backup.sql"
- task :db_import => :environment do
- filenam = 'backup.sql'
- production = YAML.load(File.read(File.join(RAILS_ROOT, "config/database.yml")))['production']
- db = production['database']
- username = production['username']
- password = production['password']
- %x{mysql #{db} < #{filename} -u #{username} -p#{password}}
- puts "====================================================="
- puts "Database imported successfully"
- puts "====================================================="
- end
Add Comment
Please, Sign In to add comment