You are here

state_flow.install in State Machine 6

Install file for the state flow module.

File

modules/state_flow/state_flow.install
View source
<?php

// $Id $

/**
 * @file
 * Install file for the state flow module.
 *
 *
 */

/**
 * Implementation of hook_install().
 */
function state_flow_install() {

  // Create tables.
  drupal_install_schema('state_flow');
  db_query("UPDATE {system} SET weight = 5 WHERE name = 'state_flow'");
}

/**
 * Implementation of hook_schema().
 */
function state_flow_schema() {
  $schema['node_revision_states'] = array(
    'description' => t('Saves the current live vid of a node'),
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'state' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
      ),
      'status' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null',
        TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'vid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_uninstall().
 */
function state_flow_uninstall() {

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

Functions

Namesort descending Description
state_flow_install Implementation of hook_install().
state_flow_schema Implementation of hook_schema().
state_flow_uninstall Implementation of hook_uninstall().