This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
desc "Clear all tables" | |
task :clear => :environment do | |
conn = ActiveRecord::Base.connection | |
conn.tables.select{|t| t.start_with? ActiveRecord::Base.table_name_prefix }.each do |t| | |
conn.drop_table t | |
end | |
end | |
desc "Dump database into an SQL file" |