For reasons of synchronizing between 2 different DBs used by different applications,
I need to change the unique primary key IDs fields of some of my models.
This is done in order to conform the relevant rows to the other DB (make sure they use the same ID).
Will changing the IDs of most of the models affect the application somehow?
Will it affect the DB? (performance-wise)
I’m assuming we have no hard-coded places in the code with specific ID numbers,
and that I would update the foreign keys with the new IDs in all the referenced tables.
I’m using MySQL.
Thanks.
Basically: No, everything should just work.
Make sure to take into account foreign keys to keep those in sync with your changes to the parent primary key.
You probably need to make sure that you reset the autoincrement counters on your mysql tables so they’re higher than the highest of your new IDs. ALTER TABLE tbl AUTO_INCREMENT = 100;