Skip to content

Instantly share code, notes, and snippets.

@jibran
Last active January 29, 2019 05:46
Show Gist options
  • Select an option

  • Save jibran/7afa1a6d90387e5ff674b6705b71af9b to your computer and use it in GitHub Desktop.

Select an option

Save jibran/7afa1a6d90387e5ff674b6705b71af9b to your computer and use it in GitHub Desktop.
Basefield scenarios in Drupal 8

There are 18 kind of different scenarios for basefield:

  1. non-translatable and non-revisionable entity with basefield with cardnality 1. One DB table: base Field column(s) in base table
  2. 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
  3. 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.
  4. 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.
  5. 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
  6. 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
  7. 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
  8. 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.

@jibran
Copy link
Author

jibran commented Jul 29, 2016

Yup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment