Sha256: 91e6b543f8aae09872d9dac1c654c7172f62c65441b065dd2f8de0d1e7c2a414
Contents?: true
Size: 843 Bytes
Versions: 15
Compression:
Stored size: 843 Bytes
Contents
namespace :alchemy do namespace :db do desc "Seeds your database with essential data for Alchemy CMS." task :seed => :environment do Alchemy::Seeder.seed! end desc "Dumps the database to STDOUT (Pass DUMP_FILENAME to store the dump into a file). NOTE: This only works with MySQL yet." task :dump => :environment do db_conf = Rails.configuration.database_configuration.fetch(Rails.env) raise "Sorry, but Alchemy only supports MySQL database dumping at the moment." unless db_conf['adapter'] =~ /mysql/ dump_store = ENV['DUMP_FILENAME'] ? " > #{Rails.root.join('db/dumps', dump_name)}" : "" cmd = "mysqldump --user='#{db_conf['username']}'#{db_conf['password'].present? ? " --password='#{db_conf['password']}'" : nil} #{db_conf['database']}#{dump_store}" system cmd end end end
Version data entries
15 entries across 15 versions & 1 rubygems