You are here

function state_flow_schema in State Machine 7.2

Same name and namespace in other branches
  1. 6 modules/state_flow/state_flow.install \state_flow_schema()
  2. 7 modules/state_flow/state_flow.install \state_flow_schema()

Implements hook_schema().

File

modules/state_flow/state_flow.install, line 22
Install file for the State Flow module.

Code

function state_flow_schema() {
  $schema['node_revision_states'] = array(
    'description' => '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',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
  );
  $schema['node_revision_states_history'] = array(
    'description' => 'Saves the state history of a node revision.',
    'fields' => array(
      'nrshid' => array(
        'description' => 'The primary identifier for this record.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      '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,
      ),
      'timestamp' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null',
        TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'log' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
      ),
    ),
    'primary key' => array(
      'nrshid',
    ),
    'indexes' => array(
      'vid' => array(
        'vid',
      ),
      'nid' => array(
        'nid',
      ),
    ),
  );
  return $schema;
}