You are here

function user_variable_schema in User variable 6

Same name and namespace in other branches
  1. 7 user_variable.install \user_variable_schema()

Implements hook_schema().

File

./user_variable.install, line 28
Install, uninstall functions for the user_variable module.

Code

function user_variable_schema() {
  $schema = array();
  $schema['user_variable'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'sid' => array(
        'description' => 'A session ID. The value is generated by PHP`s Session API.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'name' => array(
        'description' => 'The name of the variable.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'value' => array(
        'description' => 'The value of the variable.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
      ),
      'expired' => array(
        'type' => 'int',
        'description' => 'Time to which the variable is valid.',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'common' => array(
        'type' => 'int',
        'description' => 'Common variable.',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
  );
  return $schema;
}