Next Generation Schema/Advanced Relationships Table Structure: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
(add a heading so there's an edit section button available)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
#REDIRECT [[MusicBrainz_Database/Schema#Relationship_table_structure]]
===Advanced Relationships Table Structure===
[[Image:ngs-ars.png|left|frameless|550px]]
The main table is ''link''. It contains the begin and end date info, and the '''link_type''' foreign key field that specifies what kind of AR it is. It also has a count of how many other attributes that particular link has in the '''attributecount''' field.

There are tables for every possible combination of primary entities (artist, label, recording, release, release_group, url, work), all prefixed with ''l_'' and all with the same format. Four of them are shown in the diagram above. They contain a flag, '''modpending''' that marks if there are pending changes to the AR, and three foreign keys: '''link''' that points back to the associated entry in the ''link'' table, and '''entity0''' and '''entity1''' that point to the associated entry in the corresponding primary entity table (i.e. '''artist''', '''recording''', '''url''', etc.).

Latest revision as of 12:18, 24 May 2015