In Drupal 6 there are the following database tables: term_node and term_data.

What are the equivalent tables for Drupal 8?


All tables by the taxonomy module are prefixed with taxonomy_ since Drupal 7.

term_data is now taxonomy_term_data but also taxonomy_term_field_data, as it is a translatable entity. Never interact with those tables directly, use the entity API.

term_node is taxonomy_index, but it is only a secondary index you can read from there, but the primary storage are the entity_reference fields that point from nodes or any other entity type to taxonomy_term. So if you want to change values, you need use the entity API as well.

Taxonomy works very different than in Drupal 6, where you had to enable a vocabulary per-node type. Now terms work exactly the same as any other refeence, between nodes and other nodes, nodes and users and so on. The only left-over of the old system is that an index table is maintained specifically for node -> taxonomy references.

  • Thank you so much for clarify the table structure for me. I was really confused.
    – Gabriel
    Dec 21 '16 at 8:11
  • By any chance we can see all the list of changes and table structure somewhere in Drupal document?
    – Gabriel
    Dec 21 '16 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.