php - Updating PK values mysql -


i have 2 tables wish update articles , articles_entities articles has pk of id , articles_entities has fk article_id both these fields char(36) uuid. looking convert these fields int(10).

is there way can update 2 tables 1 query , key keys matching? or have write script through each articles , update references?

i using innodb if helps.

two steps:

  1. ensure foreign key set "on update cascade", update mother table's id field contains numbers. on update cascade constraint have innodb update child table updates mother... if have lot of rows, prepared extremely slow.

  2. change type of both columns int. may need drop foreign key before , re-create afterwards.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -