Difference between revisions of "Drupal/schema"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(saving work while I unstick backspace key)
 
("Content types" is another taxonomy_vocabulary thing)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
The basic unit of content in Drupal is the '''node''', which is represented by the ''nodes'' table. Key data concepts are:
 
The basic unit of content in Drupal is the '''node''', which is represented by the ''nodes'' table. Key data concepts are:
* '''content type'''
 
 
* '''node'''
 
* '''node'''
 
* '''node type'''
 
* '''node type'''
* '''tag'''
 
 
* '''taxonomy'''
 
* '''taxonomy'''
** '''taxonomy term''' - hierarchical - home table is ''taxonomy_term_data''
+
** '''taxonomy term''' - can be hierarchical - home table is ''taxonomy_term_data''
** '''taxonomy vocabulary''' - home table is ''taxonomy_vocabulary''
+
** '''taxonomy vocabulary''' - groups of taxonomy terms - home table is ''taxonomy_vocabulary''
  
 
Things you may encounter that aren't actually data concepts:
 
Things you may encounter that aren't actually data concepts:
* '''category''': it is common to have a taxonomy_vocabulary record called "category" or "categories".
+
* Some common types of taxonomy_vocabulary (i.e. 'name' field of records that might be found in a typical Drupal database):
 
+
** "Categories"
 +
** "Tags"
 +
** "Content types"
 
==Rules==
 
==Rules==
 
* Any '''node''' can be assigned to zero or more '''taxonomy term'''s. ''(taxonomy_index)''
 
* Any '''node''' can be assigned to zero or more '''taxonomy term'''s. ''(taxonomy_index)''
Line 16: Line 16:
 
* Each '''taxonomy term''' is assigned to exactly one '''taxonomy vocabulary'''. ''(taxonomy_term_data)''
 
* Each '''taxonomy term''' is assigned to exactly one '''taxonomy vocabulary'''. ''(taxonomy_term_data)''
 
* Each '''taxonomy term''' has zero or one parent and zero or more children. ''(taxonomy_term_hierarchy)''
 
* Each '''taxonomy term''' has zero or one parent and zero or more children. ''(taxonomy_term_hierarchy)''
 +
* The assigned '''taxonomy vocabulary''' determines what type of hierarchy the assigned '''taxonomy term''' belongs to:
 +
** multiple root nodes
 +
** single root node
 +
** flat list - no hierarchy

Latest revision as of 01:04, 18 June 2014

The basic unit of content in Drupal is the node, which is represented by the nodes table. Key data concepts are:

  • node
  • node type
  • taxonomy
    • taxonomy term - can be hierarchical - home table is taxonomy_term_data
    • taxonomy vocabulary - groups of taxonomy terms - home table is taxonomy_vocabulary

Things you may encounter that aren't actually data concepts:

  • Some common types of taxonomy_vocabulary (i.e. 'name' field of records that might be found in a typical Drupal database):
    • "Categories"
    • "Tags"
    • "Content types"

Rules

  • Any node can be assigned to zero or more taxonomy terms. (taxonomy_index)
  • Any taxonomy term can be assigned to zero or more nodes. (taxonomy_index)
  • Each taxonomy term is assigned to exactly one taxonomy vocabulary. (taxonomy_term_data)
  • Each taxonomy term has zero or one parent and zero or more children. (taxonomy_term_hierarchy)
  • The assigned taxonomy vocabulary determines what type of hierarchy the assigned taxonomy term belongs to:
    • multiple root nodes
    • single root node
    • flat list - no hierarchy