# Indentifier name too long

**URL:** <https://www.ruby-forum.com/t/indentifier-name-too-long/67564>\
**Category:** Rails I18n\
**Created:** [September 5, 2006, 9:57am UTC](https://www.ruby-forum.com/t/indentifier-name-too-long/67564 "2006-09-05T09:57:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dylan\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Dylan\_S](https://www.ruby-forum.com/u/Dylan_S)\
**Post date:** [September 5, 2006, 9:57am UTC](https://www.ruby-forum.com/t/indentifier-name-too-long/67564/1 "2006-09-05T09:57:33Z")

</div>

# Running Edge (4991) and MySQL (5.0.22)

When running “rake db:migrate”

Mysql::Error: Identifier name  
‘index\_globalize\_translations\_on\_table\_name\_and\_item\_id\_and\_language\_id’  
is  
too long: CREATE INDEX  
`index_globalize_translations_on_table_name_and_item_id_and_language_id`  
ON  
globalize\_translations (`table_name`, `item_id`, `language_id`)

---

<div class="post-metadata">

**Author:** ![Dylan\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Dylan\_S](https://www.ruby-forum.com/u/Dylan_S)\
**Post date:** [September 5, 2006, 10:20am UTC](https://www.ruby-forum.com/t/indentifier-name-too-long/67564/2 "2006-09-05T10:20:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dylan\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/34f0e0/32.png) [@Dylan\_S](https://www.ruby-forum.com/u/Dylan_S)\
**Post date:** [September 9, 2007, 2:05pm UTC](https://www.ruby-forum.com/t/indentifier-name-too-long/67564/3 "2007-09-09T14:05:19Z")

</div>

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

Cheers

Tim

Martin Bernd S. wrote:

> Just add a
> 
> :name =\> ï¿½??something\_idxï¿½??
