↧
Answer by Syed Haris Ali Ghaznavi for How can I rename primary key constraint...
Try thisALTER TABLE `mytable`DROP PRIMARY KEY,CHANGE COLUMN oldname newname INT(11) DEFAULT NULL,ADD CONSTRAINT `mytable_newname_pk` PRIMARY KEY (`newname`)
View ArticleHow can I rename primary key constraint in MySQL?
I have several tables with primary keys. I did not give these primary keys constraints any name. Is it possible to give them name now and how? I am using MySQL 5.7.
View Article