There are 18 kind of different scenarios for basefield:
- non-translatable and non-revisionable entity with basefield with cardnality 1. One DB table: base Field column(s) in base table
- non-translatable and non-revisionable entity with basefield with cardnality greater than 1. Two DB tables: base, field table Field column(s) in field table
- translatable and non-revisionable entity with basefield with cardnality 1. Two DB tables: base, data Field column(s) in data table
- non-translatable basefield.
- translatable basefield.
- translatable and non-revisionable entity with basefield with cardnality greater than 1. Three DB tables: base, data, field table Field column(s) in field table
- non-translatable basefield.
- translatable basefield.
- non-translatable and revisionable entity with basefield with cardnality 1. Two DB tables: base, revision
- non-revisionable basefield. Field column(s) in base table
- revisionable basefield. Field column(s) in base table and revision table
- non-translatable and revisionable entity with basefield with cardnality greater than 1.
- non-revisionable basefield. Threes DB tables: base, revision, field table Field column(s) in field table
- revisionable basefield. Four DB tables: base, revision, field table, field revision table Field column(s) in field table and field revision table
- translatable and revisionable entity with basefield with cardnality 1. Four DB tables: base, data, revision, data revision
- non-translatable and non-revisionable basefield Field column(s) in data table
- translatable and non-revisionable basefield Field column(s) in data table
- non-translatable and revisionable basefield Field column(s) in data table and revision table
- translatable and revisionable basefield Field column(s) in data table and revision table
- translatable and revisionable entity with basefield with cardnality greater than 1.
- non-translatable and non-revisionable basefield Five DB tables: base, data, revision, data revision, field table Field column(s) in field table
- translatable and non-revisionable basefield Five DB tables: base, data, revision, data revision, field table Field column(s) in field table
- non-translatable and revisionable basefield Six DB tables: base, data, revision, data revision, field table, field revision table Field column(s) in field table and field revision table
- translatable and revisionable basefield Six DB tables: base, data, revision, data revision, field table, field revision table Field column(s) in field table and field revision table
And now multiply 18 with 3 because we support three databases driver in core.
Although I started a spreadsheet it might not be necessary. Here are some thoughts.
Our fields do not have custom storage, those are not stored by this system so let's disregard that option. In order to simplify further, let's disregard keys (id, vid) and revision metadata (log). These are not interesting.
If we seek to answer the "are field columns in table X" the first question to answer is cardinality: if cardinality is not 1 then the field data goes into a dedicated table and if both the field and the entity is revisionable then there will be a dedicated field revision table for the revisions. Configurable fields behave the same as these not-1-cardinality base fields. With one exception: configurable fields are always revisionable even if the entity is not and this is why you need to check both the entity and field definitions before presuming the existence of a revision table.
Now, base fields with cardinality 1 share tables.
There can be as many as four shared tables.
If the question is: are field columns in the
Possible combinations:
No other combinations are legit.
The value of the columns are (obviously) current revision in data or base, revision data in revision or revision data table.