I have a Ruby on Rails application backed by a MySQL database. I want to add a new column of the MySQL type tinyint
to one of my existing database tables.
After creating a new ActiveRecord migration class (via the command-line generator rails generate migration
), what's the syntax to use in my add_column
method call in my change
method to add the new tinyint
-type column? That is:
class MyMigration < ActiveRecord::Migration
def change
add_column :my_existing_table_name, :my_new_column_name, # Q: What goes here?
end
end