If you want to pass specific options like the table type and the charset to use when creating tabled though Rails migrations, pass an options parameter to the create_table method:

create_table :my_table, :o ptions => 'ENGINE=InnoDB DEFAULT CHARSET=utf8', :force => true do |t|
t.column :column1, :string
t.column :column2, :string
end

One Response to “Make sure you use InnoDB and UTF-8 when creating tables through migrations”


  1. [...] You have to create them using the innodb storage engine to enable Transaction and to be able to run correctly your tests (rolling back, sandbox,..) http://significantbits.wordpress.com/2007/03/22/make-sure-you-use-innodb-and-utf-8-when-creating-tab... [...]


Leave a Reply