diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-04-27 10:21:15 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-04-27 10:21:28 -0700 |
commit | 15a4d3c383e6120bb0670fe2f9f07f72a5825027 (patch) | |
tree | 10ad838edca3ebb8a102592b7d00c93940857ad7 /activerecord/lib/active_record | |
parent | 2064c61f4b1f52dfe20bbe544db34c9fff1930b3 (diff) | |
download | rails-15a4d3c383e6120bb0670fe2f9f07f72a5825027.tar.gz rails-15a4d3c383e6120bb0670fe2f9f07f72a5825027.tar.bz2 rails-15a4d3c383e6120bb0670fe2f9f07f72a5825027.zip |
Also raise error when VERSION is nil
Fix #28905
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index f3e2df8786..711099e9e1 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -93,7 +93,7 @@ db_namespace = namespace :db do # desc 'Runs the "up" for a given migration VERSION.' task up: [:environment, :load_config] do - raise "VERSION is required" if ENV["VERSION"] && ENV["VERSION"].empty? + raise "VERSION is required" if !ENV["VERSION"] || ENV["VERSION"].empty? version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil ActiveRecord::Migrator.run(:up, ActiveRecord::Tasks::DatabaseTasks.migrations_paths, version) @@ -102,7 +102,7 @@ db_namespace = namespace :db do # desc 'Runs the "down" for a given migration VERSION.' task down: [:environment, :load_config] do - raise "VERSION is required - To go down one migration, use db:rollback" if ENV["VERSION"] && ENV["VERSION"].empty? + raise "VERSION is required - To go down one migration, use db:rollback" if !ENV["VERSION"] || ENV["VERSION"].empty? version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil ActiveRecord::Migrator.run(:down, ActiveRecord::Tasks::DatabaseTasks.migrations_paths, version) db_namespace["_dump"].invoke |