You are here

function role_watchdog_schema in Role Watchdog 7

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

Implements hook_schema().

File

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

Code

function role_watchdog_schema() {
  $schema['role_watchdog'] = array(
    'description' => 'Stores 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' => 'User ID of account.',
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
      'rid' => array(
        'description' => 'Role ID changed.',
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
      'action' => array(
        'description' => 'Action (add or remove) performed.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'User ID performing action.',
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
      'stamp' => array(
        'description' => 'Time action performed.',
        'type' => 'int',
        'unsigned' => 1,
        'not null' => TRUE,
      ),
    ),
    'indexes' => array(
      'aid' => array(
        'aid',
      ),
    ),
    'primary key' => array(
      'hid',
    ),
  );
  return $schema;
}