Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

Giving an unknown version number appears to work before it errors #1

Open
caius opened this issue May 13, 2016 · 0 comments
Open

Giving an unknown version number appears to work before it errors #1

caius opened this issue May 13, 2016 · 0 comments

Comments

@caius
Copy link
Contributor

caius commented May 13, 2016

Raises a NameError trying to find Ania::MigrationMismatch, after outputting lines that appear to be it working successfully.

We should fix the NameError at least, but I wonder if we can also check for the migration of that version before we output anything.

Otho:freeagent(use-ania)[2] caius$ ber db:check_migration VERSION=abcde --trace
** Invoke db:check_migration (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:check_migration
Migrating to the latest version
Running Rails down migration
Migrating to the latest version
rake aborted!
NameError: uninitialized constant Ania::MigrationMismatch
/Users/caius/.gem/ruby/2.1.8/bundler/gems/ania-a82642d0b868/lib/tasks/check_migration.rake:9:in `rescue in block (2 levels) in <top (required)>'
/Users/caius/.gem/ruby/2.1.8/bundler/gems/ania-a82642d0b868/lib/tasks/check_migration.rake:3:in `block (2 levels) in <top (required)>'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:248:in `call'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:248:in `block in execute'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:243:in `each'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:243:in `execute'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:14:in `block in execute'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:33:in `block in add_rails_tag'
/Users/caius/.gem/ruby/2.1.8/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/Users/caius/.gem/ruby/2.1.8/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:26:in `tagged'
/Users/caius/.gem/ruby/2.1.8/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `tagged'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:28:in `add_rails_tag'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:14:in `execute'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:50:in `block in execute'
/Users/caius/freeagent/src/freeagent/app/freeagent/app_metrics.rb:89:in `block in time'
/Users/caius/.rubies/ruby-2.1.8/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/Users/caius/freeagent/src/freeagent/app/freeagent/app_metrics.rb:89:in `time'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:50:in `execute'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/Users/caius/.rubies/ruby-2.1.8/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:180:in `invoke_with_call_chain'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:173:in `invoke'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:150:in `invoke_task'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:106:in `each'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:106:in `block in top_level'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:100:in `top_level'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:78:in `block in run'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/bin/rake:33:in `<top (required)>'
/Users/caius/.gem/ruby/2.1.8/bin/rake:22:in `load'
/Users/caius/.gem/ruby/2.1.8/bin/rake:22:in `<main>'
ActiveRecord::UnknownMigrationVersionError: 

No migration with version number 0

/Users/caius/.gem/ruby/2.1.8/gems/activerecord-4.2.6/lib/active_record/migration.rb:939:in `run'
/Users/caius/.gem/ruby/2.1.8/gems/activerecord-4.2.6/lib/active_record/migration.rb:834:in `run'
/Users/caius/.gem/ruby/2.1.8/bundler/gems/ania-a82642d0b868/lib/ania/checker.rb:80:in `run_rails_down_migration'
/Users/caius/.gem/ruby/2.1.8/bundler/gems/ania-a82642d0b868/lib/ania/checker.rb:21:in `check!'
/Users/caius/.gem/ruby/2.1.8/bundler/gems/ania-a82642d0b868/lib/tasks/check_migration.rake:6:in `block (2 levels) in <top (required)>'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:248:in `call'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:248:in `block in execute'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:243:in `each'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:243:in `execute'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:14:in `block in execute'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:33:in `block in add_rails_tag'
/Users/caius/.gem/ruby/2.1.8/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/Users/caius/.gem/ruby/2.1.8/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:26:in `tagged'
/Users/caius/.gem/ruby/2.1.8/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `tagged'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:28:in `add_rails_tag'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:14:in `execute'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:50:in `block in execute'
/Users/caius/freeagent/src/freeagent/app/freeagent/app_metrics.rb:89:in `block in time'
/Users/caius/.rubies/ruby-2.1.8/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/Users/caius/freeagent/src/freeagent/app/freeagent/app_metrics.rb:89:in `time'
/Users/caius/freeagent/src/freeagent/lib/tasks/patches.rake:50:in `execute'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/Users/caius/.rubies/ruby-2.1.8/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:180:in `invoke_with_call_chain'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/task.rb:173:in `invoke'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:150:in `invoke_task'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:106:in `each'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:106:in `block in top_level'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:100:in `top_level'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:78:in `block in run'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/Users/caius/.gem/ruby/2.1.8/gems/rake-11.1.2/bin/rake:33:in `<top (required)>'
/Users/caius/.gem/ruby/2.1.8/bin/rake:22:in `load'
/Users/caius/.gem/ruby/2.1.8/bin/rake:22:in `<main>'
Tasks: TOP => db:check_migration
  7.99s user 3.01s system 90% cpu 12.102 total
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant