You are here

function masquerade_schema in Masquerade 7

Same name and namespace in other branches
  1. 6 masquerade.install \masquerade_schema()

Implements hook_schema().

Return value

array

File

./masquerade.install, line 15
masquerade.install

Code

function masquerade_schema() {
  return array(
    'masquerade' => array(
      'description' => 'Each masquerading user has their session recorded into the masquerade table. Each record represents a masquerading user.',
      'fields' => array(
        'sid' => array(
          'description' => 'The current session for this masquerading user corresponding to their {sessions}.sid.',
          'type' => 'varchar',
          'length' => '64',
          'not null' => TRUE,
          'default' => '',
        ),
        'uid_from' => array(
          'description' => 'The {users}.uid corresponding to a session.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'disp-width' => '10',
        ),
        'uid_as' => array(
          'description' => 'The {users}.uid this session is masquerading as.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'disp-width' => '10',
        ),
      ),
      'indexes' => array(
        'sid' => array(
          'sid',
          'uid_from',
        ),
        'sid_2' => array(
          'sid',
          'uid_as',
        ),
      ),
    ),
    'masquerade_users' => array(
      'description' => 'Per-user permission table granting permissions to switch as a specific user.',
      'fields' => array(
        'uid_from' => array(
          'description' => 'The {users}.uid that can masquerade as {masquerade_users}.uid_to.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'disp-width' => 10,
        ),
        'uid_to' => array(
          'description' => 'The {users}.uid that {masquerade_users}.uid_from can masquerade as.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'disp-width' => 10,
        ),
      ),
      'primary key' => array(
        'uid_from',
        'uid_to',
      ),
    ),
  );
}