How do I retroactively add a primary key to my table in rails?

后端 未结 4 1429
眼角桃花
眼角桃花 2021-02-06 22:07

I\'ve created a table without a primary key (:id => false), but now it has come back to bite my ass.

My app is already in production and I can\'t just drop it and recre

4条回答
  •  余生分开走
    2021-02-06 23:11

    Was this a join table that now needs to become a real model with a primary key? If so, your best bet is to create the new table and copy the data into it.

提交回复
热议问题