I'm trying to remove Auto_Increment from the column
_id in my MySQL database. However that column
is the primary key
for the table and when I'm using this command
ALTER TABLE Profile
MODIFY _id INT PRIMARY KEY NOT NULL
I get an error telling me that I can't do that since there are other tables which references the primary key
.
My question is therefore: Is there a way to get around this problem?
the easiest and fastest way is the following:
set foreign_key_checks = 0;
alter table Profile change column _id _id INT NOT NULL;
set foreign_key_checks = 1;
found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With