You are here

function role_watchdog_schema in Role Watchdog 6

Same name and namespace in other branches
  1. 6.2 role_watchdog.install \role_watchdog_schema()
  2. 7.2 role_watchdog.install \role_watchdog_schema()
  3. 7 role_watchdog.install \role_watchdog_schema()

Implementation of hook_schema().

File

./role_watchdog.install, line 11
Install file for Role watchdog.

Code

function role_watchdog_schema() {
  $schema['role_watchdog'] = array(
    'description' => t('Log of all role changes.'),
    'fields' => array(
      'hid' => array(
        'description' => t('ID of the history entry.'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'aid' => array(
        'description' => t('User ID of account.'),
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
      'rid' => array(
        'description' => t('Role ID changed.'),
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
      'action' => array(
        'description' => t('Action (add or remove) performed.'),
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => t('User ID performing action.'),
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
      'stamp' => array(
        'description' => t('Time action performed.'),
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
    ),
    'indexes' => array(
      'aid' => array(
        'aid',
      ),
    ),
    'primary key' => array(
      'hid',
    ),
  );
  return $schema;
}