How to change primary key in rails migration file?

后端 未结 2 446
孤独总比滥情好
孤独总比滥情好 2021-02-08 13:29

I need to migrate an old mysql table like this:

Products
  name (string, primary_key)

to this schema:

Products
  id (integer, p         


        
2条回答
  •  一生所求
    2021-02-08 14:10

    If you're on Postgresql, the syntax is slightly different.

    ALTER TABLE  DROP CONSTRAINT _pkey;
    

提交回复
热议问题