1.1 ruby schema breaks MySQL FULLTEXT index

If you used MySQL FULLTEXT indexes and just upgraded to Rails 1.1, watch
out for this one. Rails 1.1 now defaults to Ruby as your schema format.
So instead of development-structure.sql, Rake will use schema.rb.

That’s portable and good stuff overall but there is a slight
compatibility issue. Ruby schema doesn’t know how to do FULLTEXT index
syntax for MySQL.

To work around it, you can either write migration and execute SQL, or
put:

config.active_record.schema_format = :sql

in your environment.rb to stick with SQL schema format. Don’t put
anything in schema.rb manually, it will get overwritten.

See [http://dev.rubyonrails.org/ticket/4474] for bug tracking reference.

Hi !

2006/3/28, Zak M. [email protected]:

See [http://dev.rubyonrails.org/ticket/4474] for bug tracking reference.

Actually, this is not a bug per se. Rails has database agnostic
adapters. Database-specific options like MySQL’s FULLTEXT are
unsupported by the adapters.

As you mentionned, switching back to :sql as the schema format will
keep your database specific options intact.

Bye !

François Beausoleil wrote:

Actually, this is not a bug per se. Rails has database agnostic
adapters. Database-specific options like MySQL’s FULLTEXT are
unsupported by the adapters.

I agree, FULLTEXT is not standard SQL and we can’t expect Ruby schema to
handle it. However, the generated schema.rb should not generate invalid
DDL SQL. I would rather it not create the “add_index” in schema.rb. But
then, I may be asking for too much :slight_smile: This is low low priority bug, if
anything.

  • Zak