This is an initial review of the Akonadi/MySQL Entity-Relationship Diagram (ERD).
Model Notation
Crow's Foot
Crow's Foot Refresher
The symbols at the end of each relationship define the minimum and maximum cardinality:
- | - one
- o = zero
- < = many
For example given the following:
[parent] -------o< [child]
- Each [parent] may have zero to many [child]'s
- Each [child] may have one and only one [parent]
Observations
- There are many standalone entities (e.g. [collectionpimitemrelation], [tagtypetable], [parttable], etc). I would think that somehow they would be related to some other entity.
- Perhaps this is my own ignorance of Akonadi but at first blush, I see several islands of relationships. For example, here are couple:
- [resourcetable]/[tagremoteidresourcerelationtable]
- [collectiontable]/[pimitemtable]/[relationtable]/[pimitemtagrelation]/[mimetypetable]
- The relationship [mimetypetable]/[pimitemtable] is defined such that we can have a [pimitemtable] row with no [mimetypetable] defined. I suspect that this is per specification but I want to be sure. :)
- Minor - personally, I don't like to embed the type of object in the name of the object. For example, collectiontable. This is admittedly a nitpick. ;)
- Minor - personally, it would be great to use underscores to separate names. I find it far easier to read [tag_remote_id_resource_relationship_table] than [tagremoteidresourcerelationshiptable] This is yet-another-nitpick.
Actionables
Outcomes of the current discussion in no particular order of importance or severity. Can be crossed-out once implemented/fixed.
- Eventually change Associative Tables that have Unique Key to Primary Key (like the rest) (T7846#126304)
- Drop unnecessary indexes from [CollectionTable] (T7846#126304)
- Bool-like columns should be NOT NULL (T7846#126596)
- Move [CollectionAttributeTable].type to it's own table to de-duplicate the strings, same for [TagAttributeTable] (T7846#126596, T7846#126615)
- [PimItemTable].mimeTypeId, [PimItemTable].collectionId and [RelationTable].typeId FKs should be NOT NULL (T7846#126646)