Learn about Rails migrations

What are migrations?

Migrations are a convenient way for you to alter your database in a structured and organized manner. They are a subclass of the ActiveRecord::Migration class.

The Migration class in Active Record contains helper methods that perform CRUD operations in a database-independent way. These helper methods include:

  1. add/remove/_column
  2. add/remove_index
  3. change/rename_column
  4. create/change/drop_table

These are the types of things we want our model class to be able to perform.

Get hands-on with 1200+ tech skills courses.