We have script/generate migration add_fieldname_to_tablename fieldname:datatype syntax for adding new columns to a model.
script/generate migration add_fieldname_to_tablename fieldname:datatype
On the same line, do we have a
You can also use a block if you have multiple columns to change within a table.
Example:
change_table :table_name do |t| t.change :column_name, :column_type, {options} end
See the API documentation on the Table class for more details.