/ Published in: Ruby
Drop all tables in the current database. This is useful during development where you keep changing the same migration files (logical grouping).
Expand |
Embed | Plain Text
namespace :db desc "Dropping all tables" task :drop_all => :environment do result = ActiveRecord::Migration::execute 'show tables' result.each { |table| ActiveRecord::Migration::drop_table table } end end
You need to login to post a comment.
