Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

It is recommended that foreign keys save id or code.

Shulou Source: shulou.com Published: 2022-06-03 04:33:22 11月25日 Update

Today, when working on a project, I encountered importing a batch of data, but because the basic files (only user files, departmental files, etc.) have been re-imported, the foreign key id of the document can not be associated with the previous basic file data, which would not have happened if the foreign key had used code at that time.

In addition, it is suggested that there is a special table to manage the code prefix of each document.

It's better to id, save all the codes, all right.

Tags: Files documents foundations data suggestions prefixes best users codes departments projects associations management or Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Huawei Shulou Information OPPO Reno vpn