You are here

user_variable.install in User variable 6

Same filename and directory in other branches
  1. 7 user_variable.install

Install, uninstall functions for the user_variable module.

File

user_variable.install
View source
<?php

/**
 * @file
 * Install, uninstall functions for the user_variable module.
 */

/**
* Implements hook_install().
*/
function user_variable_install() {
  drupal_install_schema('user_variable');
}

/**
* Implements hook_uninstall().
*/
function user_variable_uninstall() {
  drupal_uninstall_schema('user_variable');
}

/**
* Implements hook_schema().
*/
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;
}

Functions