You are here

function legal_schema in Legal 6.8

Same name and namespace in other branches
  1. 6.7 legal.install \legal_schema()
  2. 7.2 legal.install \legal_schema()
  3. 7 legal.install \legal_schema()

Implementation of hook_schema().

File

./legal.install, line 19
Installation and update functions for the Legal module.

Code

function legal_schema() {
  $schema['legal_conditions'] = array(
    'fields' => array(
      'tc_id' => array(
        'type' => 'serial',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'disp-width' => 10,
      ),
      'version' => array(
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => 11,
      ),
      'revision' => array(
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => 11,
      ),
      'language' => array(
        'description' => t("TODO."),
        'type' => 'varchar',
        'length' => '12',
        'not null' => TRUE,
        'default' => '',
      ),
      'conditions' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'date' => array(
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => 11,
      ),
      'extras' => array(
        'type' => 'text',
      ),
      'changes' => array(
        'type' => 'text',
      ),
    ),
    'primary key' => array(
      'tc_id',
    ),
  );
  $schema['legal_accepted'] = array(
    'fields' => array(
      'legal_id' => array(
        'type' => 'serial',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'disp-width' => 10,
      ),
      'version' => array(
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => 11,
      ),
      'revision' => array(
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => 11,
      ),
      'language' => array(
        'description' => t("TODO."),
        'type' => 'varchar',
        'length' => '12',
        'not null' => TRUE,
        'default' => '',
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => 10,
      ),
      'accepted' => array(
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => 11,
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
    'primary key' => array(
      'legal_id',
    ),
  );
  return $schema;
}