ebeard
2007-Nov-07 15:09 UTC
Is this mysql create table able to be written as a migration?
CREATE TABLE `searches` ( `id` INT UNSIGNED NOT NULL , `account_id` INT UNSIGNED NOT NULL , `searchable_id` INT UNSIGNED NOT NULL , `searchable_type` VARCHAR(255) NOT NULL , `searchable_text` TEXT NOT NULL , PRIMARY KEY ( `id` ) , FULLTEXT ( `searchable_text` ) ) ENGINE = MYISAM --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Nov-07 15:30 UTC
Re: Is this mysql create table able to be written as a migration?
On 7 Nov 2007, at 15:09, ebeard wrote:> > CREATE TABLE `searches` ( > `id` INT UNSIGNED NOT NULL , > `account_id` INT UNSIGNED NOT NULL , > `searchable_id` INT UNSIGNED NOT NULL , > `searchable_type` VARCHAR(255) NOT NULL , > `searchable_text` TEXT NOT NULL , > PRIMARY KEY ( `id` ) , > FULLTEXT ( > `searchable_text` > ) > ) ENGINE = MYISAMWell you can execute arbitrary sql in a migration so yes. You''ll have to add the fulltext index by writing a chunk of sql, create_table should be able to handle the rest. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---