Sha256: c165646e2e3866f72ba95f12c88f2c7da08b996fc16cee309e1a717074008744
Contents?: true
Size: 851 Bytes
Versions: 9
Compression:
Stored size: 851 Bytes
Contents
require 'alchemy/seeder' 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'] ? " > #{ENV['DUMP_FILENAME']}" : "" 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
9 entries across 9 versions & 1 rubygems