You are here

autotag.install in Taxonomy Autotagger 6

Same filename and directory in other branches
  1. 8.3 autotag.install
  2. 6.2 autotag.install
  3. 7.3 autotag.install

File

autotag.install
View source
<?php

/**
 * Implementation of hook_install
 */
function autotag_install() {

  // Create tables.
  drupal_install_schema('autotag');

  //Get taxonomy's weight, and increase it by ten
  $taxonomy_weight = array_pop(db_fetch_array(db_query("SELECT weight FROM {system} WHERE name='taxonomy'")));
  db_query("UPDATE {system} SET weight=%d WHERE name='autotag'", $taxonomy_weight + 10);
}

/**
 * Implementation of hook_schema
 */
function autotag_schema() {
  $tables['autotag'] = array(
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'length' => 10,
        'not null' => true,
      ),
      'tid' => array(
        'type' => 'int',
        'length' => 10,
        'not null' => true,
      ),
    ),
    'primary key' => array(
      'nid',
      'tid',
    ),
  );
  return $tables;
}

/**
 * Implementation of hook_uninstall
 */
function autotag_uninstall() {

  // Remove tables.
  drupal_uninstall_schema('autotag');
}

Functions

Namesort descending Description
autotag_install Implementation of hook_install
autotag_schema Implementation of hook_schema
autotag_uninstall Implementation of hook_uninstall