You are here

system_module.install in Util 6

Same filename and directory in other branches
  1. 6.3 system_module.install
  2. 6.2 system_module.install

File

system_module.install
View source
<?php

function system_module_install() {
  drupal_install_schema('system_module_users');
}
function system_module_uninstall() {
  drupal_uninstall_schema('system_module_users');
}
function system_module_users_schema() {

  //this is not used very much yet.

  //settings are still saved in user.data field.

  //in next update this module will move away from using user.data and instead use

  //its own configuration table
  $schema['system_module_users'] = array(
    'description' => t('Tracks users of this module to enable proper cleanup when module is disabled'),
    'fields' => array(
      'uid' => array(
        'description' => t('User\'s ID'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => t('Stores serialized array informing of the kind of customizations made by the user'),
        'type' => 'text',
        'size' => 'normal',
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}