# 1.1 ruby schema breaks MySQL FULLTEXT index

**URL:** <https://www.ruby-forum.com/t/1-1-ruby-schema-breaks-mysql-fulltext-index/56217>\
**Category:** Rails\
**Created:** [March 29, 2006, 6:01am UTC](https://www.ruby-forum.com/t/1-1-ruby-schema-breaks-mysql-fulltext-index/56217 "2006-03-29T06:01:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakmandhro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/3e96dc/32.png) [@zakmandhro](https://www.ruby-forum.com/u/zakmandhro)\
**Post date:** [March 29, 2006, 6:01am UTC](https://www.ruby-forum.com/t/1-1-ruby-schema-breaks-mysql-fulltext-index/56217/1 "2006-03-29T06:01:59Z")

</div>

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](http://dev.rubyonrails.org/ticket/4474)] for bug tracking reference.

---

<div class="post-metadata">

**Author:** ![zakmandhro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/3e96dc/32.png) [@zakmandhro](https://www.ruby-forum.com/u/zakmandhro)\
**Post date:** [March 29, 2006, 11:17am UTC](https://www.ruby-forum.com/t/1-1-ruby-schema-breaks-mysql-fulltext-index/56217/2 "2006-03-29T11:17:47Z")

</div>

Hi !

2006/3/28, Zak M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> See [[http://dev.rubyonrails.org/ticket/4474](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 !

---

<div class="post-metadata">

**Author:** ![zakmandhro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/3e96dc/32.png) [@zakmandhro](https://www.ruby-forum.com/u/zakmandhro)\
**Post date:** [March 29, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/1-1-ruby-schema-breaks-mysql-fulltext-index/56217/3 "2006-03-29T17:39:55Z")

</div>

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 🙂 This is low low priority bug, if  
anything.

- Zak
