Overview - Why migrations version the database
What is it?
In Rails, migrations are a way to change the database structure over time. Each migration has a version number that tracks the order of changes. This versioning helps Rails know which changes have been applied and which are still pending. It keeps the database schema organized and consistent.
Why it matters
Without versioning, Rails wouldn't know which changes to apply or undo, leading to confusion and errors. Imagine trying to build a house without knowing which walls are already built or which ones need fixing. Versioning migrations ensures the database evolves safely and predictably, avoiding data loss or broken apps.
Where it fits
Before learning about migration versioning, you should understand basic database concepts and how Rails migrations work. After this, you can learn about schema management, rollback strategies, and deployment workflows that rely on migration versions.