Indentifier name too long

Running Edge (4991) and MySQL (5.0.22)

When running “rake db:migrate”

Mysql::Error: Identifier name
too long: CREATE INDEX
globalize_translations (table_name, item_id, language_id)

Just add a

:name => â??something_idxâ??

parameter to the add_index statement.

Btw. If you have the same problem with foreign_keys:

  1.   create an index with a shorter name
  2.   add_fkey â?¦, :name => â??something_fkâ?, :index => false

does the trick.

Also you can handle the identifier name limit for the foreign key itself
and index with a possibly too long name will be auto created â?¦unless you
use the :index => false option. On most (all?) RDBMS you need an index
for foreign keys column(s) though.

  • Bernd

FYI - this is on line 71 of data.rake in the globalize directory



Martin Bernd S. wrote:

Just add a

:name => �??something_idx�??

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs