Migrations
Explore how Ruby on Rails migrations help you structure and organize database changes. Understand the use of ActiveRecord::Migration helper methods to create tables, add columns, and manage your schema. Gain the skills to run migrations and update your database effectively while supporting CRUD operations in Rails.
We'll cover the following...
We'll cover the following...
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:
- add/remove/_column
- add/remove_index
- change/rename_column
- create/change/drop_table
These are the types of things we want our model class to be able to perform.