$ rails g model category name:string parent_category_id:integer $ rake db:migrate mysql> select * from categories; +----+---------+--------------------+---------------------+---------------------+ | id | name | parent_category_id | created_at | updated_at | +----+---------+--------------------+---------------------+---------------------+ | 1 | metal | NULL | 2014-12-27 09:38:14 | 2014-12-27 09:38: