Forum: Ruby on Rails 1.1 ruby schema breaks MySQL FULLTEXT index

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
49c9c24cf7349be02b40f068db3a9f0e?d=identicon&s=25 Zak Mandhro (Guest)
on 2006-03-29 06:01
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.
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 François Beausoleil (fbeausoleil)
on 2006-03-29 11:17
(Received via mailing list)
Hi !

2006/3/28, Zak Mandhro <mandhro@yahoo.com>:
> 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 !
49c9c24cf7349be02b40f068db3a9f0e?d=identicon&s=25 Zak Mandhro (Guest)
on 2006-03-29 17:39
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
This topic is locked and can not be replied to.