开发者

rails error making field unique

开发者 https://www.devze.com 2023-04-12 06:35 出处:网络
I get this wh开发者_开发技巧en trying to run the migration: Mysql2::Error: Duplicate entry \'repeat\' for key \'index_industries_on_name\':

I get this wh开发者_开发技巧en trying to run the migration:

Mysql2::Error: Duplicate entry 'repeat' for key 'index_industries_on_name':

CREATE UNIQUE INDEX `index_industries_on_name` ON `industries` (`name`)

Migration is add_index :industries, :name, {:unique => true}


You have two or more rows with "repeat" as the industry name. You cannot make the name column of your industries table unique until you fix this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号