diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-06-16 19:28:38 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-06-17 09:20:58 +0200 |
commit | e2f232aba15937a4b9d14bd91e0392c6d55be58d (patch) | |
tree | a9715a517d1fd59902b104845eddcad534c94be1 /activerecord/lib/active_record/railties | |
parent | b4b5af0342cdb5917d9342cd4da245f19c3b4025 (diff) | |
download | rails-e2f232aba15937a4b9d14bd91e0392c6d55be58d.tar.gz rails-e2f232aba15937a4b9d14bd91e0392c6d55be58d.tar.bz2 rails-e2f232aba15937a4b9d14bd91e0392c6d55be58d.zip |
add `bin/rake db:purge` task to empty the current database.
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 6dca206f2a..ecf5afc4f4 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -28,6 +28,17 @@ db_namespace = namespace :db do ActiveRecord::Tasks::DatabaseTasks.drop_current end + namespace :purge do + task :all => :load_config do + ActiveRecord::Tasks::DatabaseTasks.purge_all + end + end + + # desc "Empty the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:drop:all to drop all databases in the config). Without RAILS_ENV it defaults to purging the development and test databases." + task :purge => [:load_config] do + ActiveRecord::Tasks::DatabaseTasks.purge_current + end + desc "Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)." task :migrate => [:environment, :load_config] do ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true |