Products > Database > DatabaseDocumentation > DatabaseSchema > Editing Subsystem
Database Schema: Editing subsystem
See the Database Schema page for an overview of the MusicBrainz Database and links to pages which describe each parts of the schema in more detail (like this page).
Editors enter edits (no surprises there, we hope). Those edits are stored in the moderation table. The moderator column indicates who added the edit, the type indicates what type of edit it is (see edit types).
Several of the columns have vague, fuzzy definitions, but the interpretation of their contents is really governed by first looking at the type. Each edit type has a "handler" (see the
MusicBrainz::Server::Moderation::* modules) which determines how the data required for this edit type needs to be stored in these columns, and how data, once it is extracted from them again should be handled. The "fuzzy" columns, and what is usually stored in them, are: artist - the artist this edit is attributed to (though this is a bit of a grey area; some edits affect more than one artist, and maybe some do not really belong to any artist at all. Nevertheless, an artist ID is chosen and stored in the artist column).
tab - the table being modified (e.g. artist, track etc.)
col - the column within that table being modified (e.g. name)
rowid - the primary key value of the row (in tab) being changed
prevvalue - the previous value of the column in tab, or a packed string which holds the necessary data to undo the edit once it is voted down.
newvalue - the new value of the column in tab, or a packed string which holds the necessary data to apply the edit onces it is voted in.
In practice, prevvalue is often unused and newvalue often contains a whole series of data items relevant to the edit.
The status column describes the status of the moderation (see the
ModDefs::STATUS_* constants) - for example "Open", "Deleted", "Applied", "Failed vote" etc. The columns yesvotes and novotes count the number of "yes" and "no" votes for this moderation, respectively. The column depmod is meant to indicate the ID of another edit on which this one depends, but this is generally unreliable and is being phased out. The column automod indicates whether this edit was automatically applied (i.e. was never put to the vote first). Finally opentime is when the edit was entered into the system, expiretime is the time at which voting closes (assuming votes have been cast), and closetime (which starts out as NULL) is the time at which the edit was actually closed (i.e. either applied or rejected).
The other two tables are rather simpler. moderationnote stores notes entered against edits (the editor who entered the note, the text of the note, and which edit it is for). votes stores each vote cast on each edit - who voted, on which edit, what their vote was (yes / no / abstain), and at what time they voted.
CategoryWikiDocsPage CategoryDevelopment