This project is archived and is in readonly mode.
Limit MySQL index name length
-
Nathaniel Bibler
Hrm.. the PostgreSQL adapter seems to have similar truncation logic to what I mentioned. See this ticket. It seems to truncate at 63 bytes (vs the 50 limit on MySQL).
Perhaps it would be wise to just truncate all Rails-generated indices to 50 characters? Thereby making all ActiveRecord adapters act identically..
-
Michael Sheakoski
I was able to create an index name 64 characters long on MySQL 5.0.51. Just letting you know so a fix for this issue doesn't make the name shorter than it needs to be.
-
Nate Wiger
@Bibler Any limit needs to remain database dependent as Oracle's limit is 30 chars
-
Jeremy Kemper
- State changed from duplicate to open
Santiago, this is a limit on the length of the index name.
-
Santiago Pastorino
Sorry my bad here, i should read a bit slowly the next time.
-
Jeremy Kemper
- State changed from open to duplicate
-
Gustavo Delfino
- Importance changed from to
I was just affected my this bug. As this has been marked as duplicate, I would like to know the new ticket number.
-
rcrogers
I just ran into this in Rails 2.3.8. It took me quite a while to figure out what was going on.
-
Paul Eipper
This is a duplicate of which ticket?