Here are a few gotchas:
- If you were running
spring
and didn't stop it before you squashed migrations,spring
might have it's database config change (it'll look for thesquasher
database that was created temporarily). If you want to go back to your development database, justspring stop
and then setup your database (however you do that) again. - You can run into
rake db:migrate
problems because the new squashed migration version has not been added to theschema_migrations
table that tells Rails what migrations have already been run. Thus, yourrake db:migrate
command will be trying to create tables (via thesquasher
XXXX_init_schema
migration) that already exist. The solution to this is to manually insert the value of yourXXXX_init_schema
migration into theschema_migration
table:
psql
insert into schema_migrations (version) values ('99999999999999');
, where the99999999999999
value is actually the timestamp that appears in theXXXX_init_schema
migration.