# Is this mysql create table able to be written as a migration?

**URL:** <https://www.ruby-forum.com/t/is-this-mysql-create-table-able-to-be-written-as-a-migration/119508>\
**Category:** Rails\
**Created:** [November 7, 2007, 4:10pm UTC](https://www.ruby-forum.com/t/is-this-mysql-create-table-able-to-be-written-as-a-migration/119508 "2007-11-07T16:10:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebeard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbce88/32.png) [@ebeard](https://www.ruby-forum.com/u/ebeard)\
**Post date:** [November 7, 2007, 4:10pm UTC](https://www.ruby-forum.com/t/is-this-mysql-create-table-able-to-be-written-as-a-migration/119508/1 "2007-11-07T16:10:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ebeard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbce88/32.png) [@ebeard](https://www.ruby-forum.com/u/ebeard)\
**Post date:** [November 7, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/is-this-mysql-create-table-able-to-be-written-as-a-migration/119508/2 "2007-11-07T16:31:25Z")

</div>

On 7 Nov 2007, at 15:09, ebeard wrote:

> )  
> ) ENGINE = MYISAM

Well 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
