diff --git a/db/migrate/20140813110107_set_charset_for_mysql.rb b/db/migrate/20140813110107_set_charset_for_mysql.rb index 2fc9e5ee09..23034b2404 100644 --- a/db/migrate/20140813110107_set_charset_for_mysql.rb +++ b/db/migrate/20140813110107_set_charset_for_mysql.rb @@ -40,10 +40,10 @@ def change case type when :string, :text - options.update(charset: 'utf8', collation: 'utf8_general_ci') + options.update(charset: 'utf8', collation: 'utf8_unicode_ci') case name when 'username' - options.update(limit: 767 / 4, charset: 'utf8mb4', collation: 'utf8mb4_general_ci') + options.update(limit: 767 / 4, charset: 'utf8mb4', collation: 'utf8mb4_unicode_ci') when 'message', 'options', 'name', 'memory', 'handler', 'last_error', 'payload', 'description' options.update(charset: 'utf8mb4', collation: 'utf8mb4_bin') @@ -60,10 +60,10 @@ def change change_column table_name, name, type, options } - execute 'ALTER TABLE %s CHARACTER SET utf8 COLLATE utf8_general_ci' % table_name + execute 'ALTER TABLE %s CHARACTER SET utf8 COLLATE utf8_unicode_ci' % table_name } - execute 'ALTER DATABASE %s CHARACTER SET utf8 COLLATE utf8_general_ci' % conn.current_database + execute 'ALTER DATABASE %s CHARACTER SET utf8 COLLATE utf8_unicode_ci' % conn.current_database end dir.down do diff --git a/db/schema.rb b/db/schema.rb index d81f9d01db..87ef076c52 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -143,7 +143,7 @@ t.integer "failed_attempts", default: 0 t.string "unlock_token" t.datetime "locked_at" - t.string "username", limit: 191, null: false, charset: "utf8mb4", collation: "utf8mb4_general_ci" + t.string "username", limit: 191, null: false, charset: "utf8mb4", collation: "utf8mb4_unicode_ci" t.string "invitation_code", null: false, collation: "utf8_bin" t.integer "scenario_count", default: 0, null: false end