Sha256: fa0a2881afe2511260034d9c8b7761b531ee73870bc0fe16a99efeb7da50fb08
Contents?: true
Size: 789 Bytes
Versions: 2
Compression:
Stored size: 789 Bytes
Contents
config = Rails.application.config database = config.database_configuration[Rails.env]["database"] username = config.database_configuration[Rails.env]["username"] password = config.database_configuration[Rails.env]["password"] namespace :db do #rake db:dump desc "dumps the database to a sql file" task :dump => :environment do puts "Creating #{database}_dump.sql file." `mysqldump -u "#{username}" --password="#{password}" "#{database}" > "#{database}"_dump.sql` end namespace :dump do #rake db:dump:import - Resets the DB. desc "imports the #{database}_dump.sql file to the current db" # TODO add :reset as prerequisite... task :import do `mysql -u root --password="#{password}" "#{database}" < "#{database}"_dump.sql` end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rake-kit-0.1.5 | lib/tasks/dumps.rake |
rake-kit-0.1.2 | lib/tasks/dumps.rake |