Created
February 27, 2009 17:06
-
-
Save ryanbriones/71573 to your computer and use it in GitHub Desktop.
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
# db:migrate:reset was doing nothing for me against (jruby) jdbc/oracle. | |
# added this task, and all is well with the world. | |
# written for Rails 2.2 | |
namespace :db do | |
task :drop do | |
unless defined? RAILS_ENV | |
RAILS_ENV = ENV['RAILS_ENV'] ||= 'development' | |
end | |
config = Rails::Configuration.new.database_configuration[RAILS_ENV] | |
ActiveRecord::Base.establish_connection(config) | |
ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.drop_table(t) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment