lineage.install in Taxonomy Lineage 7
Same filename and directory in other branches
Install, update, and uninstall functions for the Taxonomy Lineage module.
File
lineage.installView 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
Name | Description |
---|---|
lineage_schema | Implementation of hook_schema(). |
lineage_update_7000 | Implements hook_update_N(). |