4 ms·
> If you have to move the site to a different box, can you guarantee that those database IDs will remain the same? If you don't, then your foreign keys will be
by jolmg 8y ago
> If you have to move the site to a different box, can you guarantee that those database IDs will remain the same?
If you don't, then your foreign keys will be broken.
> If you have to restore the site’s data from a backup, can you guarantee that those database IDs will remain the same?
Ditto. If they're not, then that backup seems broken.
> If you have to switch to a different database server (say from Microsoft SQL Server to Oracle), can you guarantee that those database IDs will remain the same?
Ditto.
I've only had one situation where I had to change the database ids, including making sure to change all foreign keys accordingly in all tables, and that was when I was migrating multiple company-hosted instances of a webapp they had in their intranets to a unified internet-hosted server. I was merging multiple databases into one so modifying ids was necessary so they wouldn't clash.
At least in my case, I don't think any of those companies' employees would have had the expectation for their intranet URLs to work. I mean, even the host/domain part of the URI changed. Why would they have the expectation for the path part to still work?