Can not alter table because animal id is foreign key in different table
ALTER TABLE 'animal' CHANGE 'animal_id' 'animal_id' INT(11) NOT NULL AUTO_INCREMENT;
Can not alter table because animal id is foreign key in different table
ALTER TABLE 'animal' CHANGE 'animal_id' 'animal_id' INT(11) NOT NULL AUTO_INCREMENT;
2
Answers
Because I can’t see your full code, however, I think you can try this:
I think you could do something similar to this response: How to update primary key. When you update the PK, I think you could do something like this response: Alter a MySQL column to be AUTO_INCREMENT.
But since this response is not best practice, if you don’t need the data in the table, you could drop and then recreate the table.