You are here

lineage.install in Taxonomy Lineage 7

Same filename and directory in other branches
  1. 5 lineage.install
  2. 6 lineage.install

Install, update, and uninstall functions for the Taxonomy Lineage module.

File

lineage.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Taxonomy Lineage module.
 */

/**
 * Implementation of hook_schema().
 */
function lineage_schema() {
  $schema['taxonomy_term_lineage'] = array(
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'lineage' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'depth' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'lineage' => array(
        'lineage',
      ),
    ),
    'primary key' => array(
      'tid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_update_N().
 *
 * Rename the lineage table to be similar to other Drupal 7 taxonomy table names.
 */
function lineage_update_7000() {
  db_rename_table('term_lineage', 'taxonomy_term_lineage');
  return t('Changed the lineage data table name to <em>taxonomy_term_lineage</em>.');
}

Functions

Namesort descending Description
lineage_schema Implementation of hook_schema().
lineage_update_7000 Implements hook_update_N().