...

/

Creating Correct Migrations

Creating Correct Migrations

Learn how to create correct migrations in our Rails application.

Crafting and ensuring the desired database schema

Writing migrations is how we programmatically modify the database to conform to the physical schema we want to use. Because Rails’ API for doing this is not SQL, it’s important that we take some time to make sure the migrations we write result in the schema we need. Rails’ API is powerful and will save us time and make the work easier, but it lacks a few useful defaults.

In the previous chapter, we created models so we could talk about some model ...