Add new column (basic) $ rails g migration (process to be performed + table name) (column and data type you want to add, etc.)
$rails g migration AddColumnToUsers name:string age:integer
Add index to new column
$rails g migration AddColumnToUsers name:string:index
Delete column
string
Create columns at the same time as creating tables
$rails g migration CreateUsers name:string age:integer
Recommended Posts