You are here

function realname_schema in Real Name 7

Same name and namespace in other branches
  1. 8 realname.install \realname_schema()
  2. 6 realname.install \realname_schema()
  3. 2.x realname.install \realname_schema()

Implements hook_schema().

File

./realname.install, line 11
Installation file for Realname module.

Code

function realname_schema() {
  $schema['realname'] = array(
    'description' => 'Computed Real Names to reduce overhead.',
    'fields' => array(
      'uid' => array(
        'description' => 'User ID, links to User table.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'realname' => array(
        'description' => 'The generated real name of the user.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'created' => array(
        'description' => 'The UNIX timestamp of when the real name was created.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
    ),
    'indexes' => array(
      'realname' => array(
        'realname',
      ),
    ),
    'foreign keys' => array(
      'users' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
  );
  return $schema;
}