Mysql - Add auto_increment to primary key
I have a strange problem with mysql. I am trying to alter a table's column which is a primary key and has an auto_increment constraint defined on it. This is also a foreign key reference for multiple other tables. I need to change the length of this column in both , parent and all children. set foreign_key_checks=0; alter table Parent modify Identifier smallint(10) unsigned; alter table Child_1 modify FK_Identifier smallint(10) unsigned; alter table Child_2 modify FK_Identifier smallint(10) unsigned; alter table Child_3 modify FK_Identifier smallint(10) unsigned; alter table Child_4 modify FK