Tag Archives: Db

What collation/encoding is my database using?

Very simple.

USE `your_database`
show variables like "character_set_database";
show variables like "collation_database";

Rails test database not resetting correctly

I have no idea why, but so far I’ve had this problem twice. My specs suddenly start failing for no apparent reason. When digging deeper, it seems my test database is not reset before starting the tests. Therefor quite a few validations fail because of unique constraints. The following code cleans the test database up.

rake db:test:prepare