Defect #6051

undefined method `length' for :changesets_repos_scmid:Symbol

Added by alexander smishlajev about 8 years ago. Updated about 8 years ago.

Status:ClosedStart date:2010-08-06
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Database
Target version:-
Resolution:Duplicate Affected version:

Description

I am trying to upgrade from repository revision 3358 to revision 3917. The database migration aborts with this error message:

undefined method `length' for :changesets_repos_scmid:Symbol

Full traceback:

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  AddIndexOnChangesetsScmid: migrating ======================================
-- add_index(:changesets, [:repository_id, :scmid], {:name=>:changesets_repos_scmid})
rake aborted!
An error has occurred, this and all later migrations canceled:

undefined method `length' for :changesets_repos_scmid:Symbol
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/schema_statements.rb:281:in `add_index'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:352:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:352:in `method_missing'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:328:in `say_with_time'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:328:in `say_with_time'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:348:in `method_missing'
./db/migrate//20100221100219_add_index_on_changesets_scmid.rb:3:in `up_without_benchmarks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `migrate'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in `__send__'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:491
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:565:in `call'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:565:in `ddl_transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/transactions.rb:182:in `transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:565:in `ddl_transaction'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:490:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:401:in `up'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:383:in `migrate'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/databases.rake:112
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

The system is running on FreeBSD 8.1 with Rails version 2.3.8.


Related issues

Duplicates Redmine - Defect #5723: Error db:migrate with rails=2.3.8 Closed 2010-06-22

History

#1 Updated by alexander smishlajev about 8 years ago

See #5723. It helps to put quotes around the index name in database migration script (db/migrate/20100221100219_add_index_on_changesets_scmid.rb):

add_index :changesets, [:repository_id, :scmid], :name => "changesets_repos_scmid" 

#2 Updated by Felix Schäfer about 8 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Closing as it is a duplicate of #5723.

And I'll repeat what I said in the other ticket: rails 2.3.8 is not supported yet.

#3 Updated by James Byrne about 8 years ago

This is a bug in Rails which has a patch but which has not been pulled into the master branch.

https://rails.lighthouseapp.com/projects/8994/tickets/4891-rails-238-dbmigrate-gives-undefined-method-length-for-any_indexsymbol

Also available in: Atom PDF