You are here

function user_variable_schema in User variable 7

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

Implements hook_schema().

File

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

Code

function user_variable_schema() {
  $schema = array();
  $schema['user_variable'] = array(
    'description' => 'Stores user variables.',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'User {users}.uid.',
      ),
      '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;
}