It is better to write a migration, and it is mandatory if you are working with a team. When you make changes to db, you must also update each development environment. Otherwise, you will have crazy developers.
rails generate migration AddPartNumberToProducts part_number:string
will generate
class AddPartNumberToProducts < ActiveRecord::Migration def change add_column :products, :part_number, :string end end
Then migration
rake db:migrate
http://guides.rubyonrails.org/migrations.html
Edit:
For the rails command line command line check @tadman's answer or use what Bengala suggested, e.g.
ActiveRecord::Migration.add_column :products, :part_number, :string
source share