#1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150)

后端 未结 7 1361
星月不相逢
星月不相逢 2020-12-12 14:34

So I am trying to add a primary key to one of the tables in my database. Right now it has a primary key like this:

PRIMARY KEY (user_id, round_number)


        
相关标签:
7条回答
  • 2020-12-12 15:31

    As was said you need to remove the FKs before. On Mysql do it like this:

    ALTER TABLE `table_name` DROP FOREIGN KEY `id_name_fk`;
    
    ALTER TABLE `table_name` DROP INDEX `id_name_fk`;
    
    0 讨论(0)
提交回复
热议问题