You are here

function externalauth_schema in External Authentication 8

Same name and namespace in other branches
  1. 2.0.x externalauth.install \externalauth_schema()

Implements hook_schema().

File

./externalauth.install, line 21
Install, update and uninstall functions for the externalauth module.

Code

function externalauth_schema() {
  $schema['authmap'] = [
    'description' => 'Stores distributed authentication mapping.',
    'fields' => [
      'uid' => [
        'description' => 'Primary key: {users}.uid for user.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'provider' => [
        'description' => 'The name of the authentication provider providing the authname',
        'type' => 'varchar_ascii',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ],
      'authname' => [
        'description' => 'Unique authentication name provided by authentication provider',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ],
      'data' => [
        'description' => 'Extra (serialized) data to store with the authname.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
      ],
    ],
    'primary key' => [
      'uid',
      'provider',
    ],
    'indexes' => [
      'uid' => [
        'uid',
      ],
    ],
    'unique keys' => [
      'authname_provider' => [
        'authname',
        'provider',
      ],
    ],
    'foreign keys' => [
      'uid' => [
        'users' => 'uid',
      ],
    ],
  ];
  return $schema;
}