You are here

term_authoring_info.install in Taxonomy Term Authoring Information 7

Install, update and uninstall functions for term_authoring_info module.

File

term_authoring_info.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for term_authoring_info module.
 */

/**
 * Implements hook_uninstall().
 */
function term_authoring_info_uninstall() {

  // Clear the vocab specific variables.
  $vocabs = taxonomy_get_vocabularies();
  foreach ($vocabs as $vid => $vocab) {
    variable_del("term_authoring_info_vocab_{$vocab->machine_name}_showfield");
  }
}

/**
 * Implements hook_schema().
 */
function term_authoring_info_schema() {
  $schema['term_authoring_info'] = array(
    'description' => 'Stores term authoring information',
    'fields' => array(
      'tid' => array(
        'description' => 'Primary Key: Unique term ID.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The {users}.uid that owns this term; initially, this is the user that created it.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the term was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'changed' => array(
        'description' => 'The Unix timestamp when the term was most recently saved.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'term_changed' => array(
        'changed',
      ),
      'term_created' => array(
        'created',
      ),
    ),
    'primary key' => array(
      'tid',
    ),
    'foreign keys' => array(
      'term_id' => array(
        'table' => 'taxonomy_term_data',
        'columns' => array(
          'tid' => 'tid',
        ),
      ),
      'term_author' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
  );
  return $schema;
}

Functions