I have a content type in drupal 8 and which table stores the content type fields and type in drupal 8 ? Unlike in drupal 6
(in which there will be tables specifically for content types) like content_type_contenttypename
its not creating the table and fields . Where will be these fields and data types stored in drupal 8 ??
2 Answers
Drupal 8:
- Content type = Bundle
Node = Entity
Base fields are in one table:
[entity]_field_data
- Bundle fields are in seperate tables:
[entity]__field_name
Bundle fields are stored in the same table for all bundles of one entity and can be shared between bundles of the same entity but not with another entity.
-
I'm just trying to work out what that
bundle
column in the field tables is actually for, do you know? Given that entity IDs are unique, and a node can only have one bundle, I'm struggling to come up with anything that would make it useful. The description says it's used for when fields are deleted, but that doesn't make sense to me either...– Clive ♦Jul 21, 2016 at 13:07 -
3Bundle is an index key, so this is probably to find content faster. For example if you want to delete a bundle you would otherwise have to go through the complete table.– 4uk4Jul 21, 2016 at 13:10
-
-
I migrated from d6->d8 , so there are many tables starting migrate_map_d6_ and migrate_message_d6_ . Any idea about this ?– KTMJul 21, 2016 at 13:21
-
Each field values will be stored in a separate table.
For field foo the table name will be node__foo
-
So there wont be any table specific to content types ? for each fields in a content type there will be as much tables ?– KTMJul 21, 2016 at 13:02
-
Yes. This is the default behavior for bundle (content for for nodes) specific fields in drupal 8– EyalJul 21, 2016 at 13:18
-
@Icecreamsandwich IIRC, that changed in D7 when proper field support was introduced in core (rather than CCK). The D6 method of sometimes using the content type table for field data was fragile, and ended up with broken queries when things changes. This makes it more stable and predictable.– mpdonadio ♦Jul 21, 2016 at 14:36