How to make utf-8 rails migration instead of my default latin1

I just checked my MySQL tables, and by default I have it set to latin1. Is this usually the default value?

How can I make it explicit for all my tables that I want the database to be utf-8?

I know there is a db configuration that can change the default value, but I think there is also a way to do this for each migration. How can I finally install the rail migration from now on to utf-8?

Thanks!

+8
mysql ruby-on-rails-3 migration utf-8 latin1
source share
1 answer

create_table(:table_name, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8')

+16
source share

All Articles