This project is archived and is in readonly mode.

#779 ✓stale
Ryan Mulligan

Schema dump does not honor Sub_Part column

Reported by Ryan Mulligan | August 7th, 2008 @ 11:03 PM | in 2.x

Indexing some fields (text, blob) requires a SubPart field to be set in the Index table. Unfortunately rake db:schema:dump ignores this field and creates a simple addindex in the schema. When the test database tries to use a simple index, it fails because MySQL requires the Sub_part be set.

My recommended fix is to include an extra option in the addindex command to include Subparts.

example of error failing (name is a text field): ryan@rtmlap:~/bs$ rake test:units (in /home/ryan/bs) rake aborted! Mysql::Error: BLOB/TEXT column 'name' used in key specification without a key length: CREATE INDEX taggings ON tags (id, name)

Expected index creation to be:

CREATE INDEX taggings ON tags (id, name(30))

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages