While creating a web application we create models in our application which act as tables in the database. Sometimes when the development of the application moves further, the need arises to add a column to our existing table or removing a column from the table or just changing it.
To achieve this, rails active records provide us with migrations with which we can easily do the desired changes in our table. Below are the ways defined to alter our table with the help of migrations.
Adding a column
Let the table be user table and suppose we need to add address column to the table so to add the address column to the user table we need to write this on our console.