Ruby on Rails: adding columns to existing database

前端 未结 7 714
Happy的楠姐
Happy的楠姐 2021-01-30 07:49

I\'m getting an error:

SQLite3::SQLException: no such column: ideas.list_id: 
SELECT \"ideas\".* FROM \"ideas\"  
WHERE \"ideas\".\"list_id\" = 2
7条回答
  •  借酒劲吻你
    2021-01-30 08:14

    If you want to add a new column to an exist database, you should use rails generate migration. So you can try rails generate migration add_list_id_to_ideas list_id:integer and then use rake db:migrate to commit this change.

提交回复
热议问题