# Simple Migration Question: Specifying a key length

**URL:** <https://www.ruby-forum.com/t/simple-migration-question-specifying-a-key-length/115308>\
**Category:** Rails\
**Created:** [September 23, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/simple-migration-question-specifying-a-key-length/115308 "2007-09-23T16:45:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben-v](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecb155/32.png) [@ben-v](https://www.ruby-forum.com/u/ben-v)\
**Post date:** [September 23, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/simple-migration-question-specifying-a-key-length/115308/1 "2007-09-23T16:45:18Z")

</div>

Is there any way to create a key length for a text index using  
add\_index? Whenever I tree and create a text-based, rather than integer  
based index, it aborts the rake because I did not specify a key length.  
I looked at the add\_index documentation, and can’t find a way to specify  
this. How do I rectify this error:  
Mysql::Error: BLOB/TEXT column ‘url’ used in key specification without a  
key length: CREATE INDEX `index_users_on_url` ON user (`url`)

Thanks,  
Ben
