Rails generate Migration

Just run

rails g migration add_description_to_products description:string
rails g migration add_product_type_to_products product_type:string

and then run

rake db:migrate

In the development of any practical application, you will be doing quite a few migrations which are basically DDL (data definition language) statements. In real life, you will have several environments (development, test, production, etc.) and it is highly possible that you will be changing the development database while you have a version in production. For this reason, the Rails way is to generate a new migration for any changes to the database instead of making direct changes to existing migration file.

So, familiarize yourself with migrations.

For the specific question, you can do:

rails g migration add_attributes_to_products attr1 attr2 attr3

This will generate a new migration file for adding 3 new attributes to products table (to the Product model). The default type for the attributes is string. For others, you have specify it like:

rails g migration add_attributes_to_products attr1:integer attr2:text attr3:enum

use rollback if your last action is migration

rake db:rollback

Then add attributes in the migration file

class CreateProducts < ActiveRecord::Migration
  def change
    create_table :products do |t|
      t.string  :name
      t.decimal :price
      t.text    :description
      t.string  :product_type  #adding product_type attribute to the products table
      t.timestamps
    end
   end
 end

After that migrate using

rake db:migrate

If migrate is not your last action, generate a new migration file as of in the above answers

rails g migration add_attributes_to_products product_type:string

The above code only generates the migration file but you want to use rake db:migrate to migrate the file.

If you want to do any more changes to that migration file such as adding more atributes do it before migrating otherwise you have to use the method I mentioned in the beginning if your last action is migration or else you need to generate another migration file. check this link to know more about migration http://guides.rubyonrails.org/v3.2.8/migrations.html