You are here

function nodehierarchy_schema in Node Hierarchy 6

Same name and namespace in other branches
  1. 6.3 nodehierarchy.install \nodehierarchy_schema()
  2. 6.2 nodehierarchy.install \nodehierarchy_schema()
  3. 7.4 nodehierarchy.install \nodehierarchy_schema()
  4. 7.2 nodehierarchy.install \nodehierarchy_schema()

Implementation of hook_schema().

File

./nodehierarchy.install, line 22

Code

function nodehierarchy_schema() {
  $schema['nodehierarchy'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The {node}.nid whose parent is being defined.'),
      ),
      'parent' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The {node}.nid of the parent node.'),
      ),
      'order_by' => array(
        'type' => 'float',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('The sort order or weight of the node.'),
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}