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. -- Posted via http://www.ruby-forum.com/.
Francois Beausoleil
2006-Mar-29 09:17 UTC
[Rails] 1.1 ruby schema breaks MySQL FULLTEXT index
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 ! -- Fran?ois Beausoleil http://blog.teksol.info/
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 -- Posted via http://www.ruby-forum.com/.