You are here

alchemy.install in Alchemy 7

Same filename and directory in other branches
  1. 6 alchemy.install

Install, update and uninstall functions for the alchemy module.

File

alchemy.install
View source
<?php

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

/**
 * Implements hook_install().
 */
function alchemy_install() {

  // TODO The drupal_install_schema functions are called automatically in D7.
  // drupal_install_schema('alchemy')
  drupal_set_message(check_plain('Alchemy has been installed.'));
}

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

  // TODO The drupal_uninstall_schema functions are called automatically in D7.
  // drupal_uninstall_schema('alchemy')
  drupal_set_message(t('Alchemy has been uninstalled.'));
}

/**
 * Implements hook_schema().
 */
function alchemy_schema() {
  $schema['alchemy_cache'] = array(
    'description' => 'Creates database table to cache Alchemy data.',
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The nid for the analyzed node.',
      ),
      'path' => array(
        'type' => 'text',
        'description' => 'Path of the analyzed content',
      ),
      'created' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The unix time the recored was created.',
      ),
      'command' => array(
        'type' => 'text',
        'description' => 'Command request to Alchemy',
      ),
      'data' => array(
        'type' => 'text',
        'not null' => TRUE,
        // 'default' => '',
        'description' => 'Cached data.',
      ),
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
      'path' => array(
        array(
          'path',
          18,
        ),
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
alchemy_install Implements hook_install().
alchemy_schema Implements hook_schema().
alchemy_uninstall Implements hook_uninstall().