edk2toollib/database: remove autoincrement id #412
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removes autoincrementing primary keys from
instanced_fv
,instanced_inf
andsource
tables. Tables depending on an autoincremented index as a foreign key end up breaking when doing a naive merge of two databases as the index is automatically updated in the table where it is the primary key, but it is not updated in the table where it is a foreign key, thus breaking the association.To support merging two databases where we will never know the true tables in the database (A developer can register a subset of provided tables or create their own), core tables should not use autoincremented primary keys.
instanced_fv table
This removal was simple as there was no existing dependencies that utilized the auto-incremented primary key. Getting the same association can be done via combining the
env
andfv_name
columns.instanced_inf table
This removal is more complex as the autoincremented id was directly used when associating the inf's with each other (when forming a dependency list). Getting the same association can be done via combining the
env
andcomponent
columns. This change made it such that the providedjunction
table does not work, and aninstanced_inf_junction
table was created to support this.source table
This removal was simple as there was no existing dependencies that utilized the auto-incremented primary key. Getting the same association can be done via the
path
column.