ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Error in "rake db:migrate:down VERSION=20100714111652" (Bug #1164)


Added by Toshi MARUYAMA at 2012-10-14 05:09 pm. Updated at 2013-03-19 09:53 pm.


Status:Closed Start date:2012-10-15
Priority:Normal Due date:
Assignee:Holger Just % Done:

0%

Category:-
Target version:3.8.0
Remote issue URL: Affected version:3.3.0

Description

On 003fc93b153c9b

$ rake db:migrate:down VERSION=20100714111652 RAILS_ENV=test
==  UpdateJournalsForActsAsJournalized: reverting =============================
-- change_table("journals")
   -> 0.0226s
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.collect

Tasks: TOP => db:migrate:down
(See full trace by running task with --trace)

chili-fix-db-migrate-01.diff (862 Bytes) Toshi MARUYAMA, 2012-10-14 05:35 pm


Associated revisions

Revision 251b1f75
Added by Jean-Philippe Lang at 2008-05-02 06:48 pm

Fixed: error on Trac import when :due attribute is nil (#1164).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1406 e93f8b46-1217-0410-a6f0-8f06a7374b81

History

Updated by Toshi MARUYAMA at 2012-10-14 05:12 pm

With --trace option

$ rake db:migrate:down --trace  VERSION=20100714111652 RAILS_ENV=test
** Invoke db:migrate:down (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate:down
==  UpdateJournalsForActsAsJournalized: reverting =============================
-- change_table("journals")
   -> 0.0229s
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.collect
./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:53:in `down_without_benchmarks'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `send'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `migrate'
/home/xxxxxxx/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.3.14/lib/active_record/migration.rb:282:in `migrate'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `__send__'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.3.14/lib/active_record/migration.rb:365:in `migrate'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.3.14/lib/active_record/migration.rb:457:in `run'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.3.14/lib/active_record/migration.rb:409:in `run'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358/gems/rails-2.3.14/lib/tasks/databases.rake:143
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/home/xxxxxxx/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/bin/rake:33
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/bin/rake:19:in `load'
/home/xxxxxxx/.rvm/gems/ruby-1.8.7-p358@global/bin/rake:19
Tasks: TOP => db:migrate:down

Updated by Toshi MARUYAMA at 2012-10-14 05:35 pm

This is a patch to fix.

Updated by Chris Dähn at 2012-12-18 12:56 am

@Felix, Holger & Co.: Could you check the patch or can I help checking it?

  • Status changed from Open to Ready for review

Updated by Felix Schäfer at 2013-01-14 01:58 pm

Chris Dähn wrote:

@Felix, Holger & Co.: Could you check the patch or can I help checking it?

In this case confirming the issue and that the fix works for you and/or having a look at the code confirming that the removed variable wasn't used anywhere anyway would have helped :-)

As far as I can see the variable isn't used anywhere in the down migration, merging this soon.

  • Assignee set to Felix Schäfer
  • Target version set to 3.8.0

Updated by Chris Dähn at 2013-01-16 10:14 pm

Thanks and: Sorry, that I couldn't help - thought it was not as easy as it pointed out now ashamed...

Updated by Felix Schäfer at 2013-03-19 09:53 pm

Pushed in 90a05668. Thanks Toshi!

  • Assignee changed from Felix Schäfer to Holger Just
  • Status changed from Ready for review to Closed

Also available in: Atom PDF