# Add\_index problems

**URL:** <https://www.ruby-forum.com/t/add-index-problems/91462>\
**Category:** Rails\
**Created:** [April 9, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/add-index-problems/91462 "2007-04-09T15:08:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre-Alexandre\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c4cdca/32.png) [@Pierre-Alexandre\_M](https://www.ruby-forum.com/u/Pierre-Alexandre_M)\
**Post date:** [April 9, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/add-index-problems/91462/1 "2007-04-09T15:08:48Z")

</div>

Hi all,

I think there’s a bug in rake db:schema:dump.

Try to add in your migration  
execute ‘ALTER TABLE posts ADD UNIQUE (description(15))’

and rake db:schema:load : it just converts it to  
add\_index “posts”, [“description”], :name =\> “description”, :unique =\>  
true

The point is that MySQL will crash when you’ll try rake your tests.  
Assuming description is a ‘text’, you need to specify length of the  
index.

Am I wrong? Does someone can reproduce the bug?

–  
,========================.  
| Pierre-Alexandre M. |  
| email : removed\_email\_address@domain.invalid |  
`========================’
