Any thoughts on how to avoid this problem? Already tried:
1. Setting the charset and collation in migration 001 - no effect:
def self.up db_name = ActiveRecord::Base::connection.current_database() execute "ALTER DATABASE #{db_name} CHARACTER SET utf8 COLLATE utf8_bin" end
2. Setting the charset and collation on each table individually - no effect: {:options=>"engine=InnoDB CHARACTER SET utf8 COLLATE utf8_bin"}
Note that development and production environments work fine with database default, migration 001, or setting per each table. Only the test db, specifically after a rake test:units run has this problem.
Repro:
1. Create DB (MySQL 5.0.24a) CREATE DATABASE foobar CHARACTER SET utf8 COLLATE utf8_bin;
2. Run migration (Rails 1.2)
3. Verify database and all tables have charset utf8 and collation of utf_bin: yes. select @@character_set_server, etc... ---------------------- ------------------ ------------------------