Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Created February 27, 2009 17:06
Show Gist options
  • Save ryanbriones/71573 to your computer and use it in GitHub Desktop.
Save ryanbriones/71573 to your computer and use it in GitHub Desktop.
# 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