rails add subcategory migration code example
Example 1: rails g migration add columns
$ rails generate migration AddDetailsToProducts part_number:string price:decimal
Example 2: rails migration populate data
class AddSystemSettings < ActiveRecord::Migration
def change
create_table :system_settings do |t|
t.string :name
t.integer :position
end
# populate the table
SystemSetting.create :name => "notice"
end
end