Migrations

Schema as versioned Ruby

So far dogpark has exactly one table, walkers, and you got it for free from bin/rails g scaffold. From here on you're hand-building models β€” starting with Dog β€” so it's time to see what a migration actually is: a plain Ruby file that describes one change to your database's shape, checked into git like any other source file, applied in order.

Think of migrations as version control for the schema. Just like git tracks changes to code over time, migrations track changes to your tables over time β€” one file per change, timestamped, replayable from scratch on a fresh database.