Up And Down Again: A Migration's Tale
summary
Explains exactly what rake db:migrate and db:schema:load execute, how migration versions map to the schema_migrations table, and why Rails uses compatibility shims so old migrations keep their original behavior. Dives into the adapter pattern that emits different SQL per DB, shows the command recorder mechanism that makes change reversible, counts practical limits (no built‑in views/triggers/functions), describes building the Scenic gem to add views (it works but requires tricky ordering and dumping), and recommends switching to structure.sql for advanced DB features.
AI-written summary · about
chapters (9)
- 0:00Introduction and history
- 1:47Anatomy of a migration
- 5:58Schema statements and adapters
- 11:35Applying migrations
- 15:01Reverting migrations
- 19:18Schema dumper
- 21:51Migration rot
- 25:22Advanced database features
- 30:06Conclusion and takeaways








