You are here

function ulogin_schema in uLogin (advanced version) 8

Same name and namespace in other branches
  1. 6 ulogin.install \ulogin_schema()
  2. 7 ulogin.install \ulogin_schema()

Implements hook_schema().

File

./ulogin.install, line 18
File ulogin.install.

Code

function ulogin_schema() {
  $schema = [];
  $schema['ulogin_identity'] = [
    'description' => 'Holds identities from uLogin service.',
    'fields' => [
      'id' => [
        'description' => 'Unique id of uLogin identity.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'uid' => [
        'description' => 'The {users}.uid that owns this uLogin identity.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'network' => [
        'description' => 'The authentication provider for this uLogin identity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ],
      'ulogin_uid' => [
        'description' => 'The uLogin uid for this uLogin identity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ],
      'data' => [
        'description' => 'A serialized array containing information from uLogin service.',
        'type' => 'blob',
        'not null' => TRUE,
        'size' => 'normal',
      ],
    ],
    'indexes' => [
      'uid' => [
        'uid',
      ],
    ],
    'unique keys' => [
      'network_ulogin_uid' => [
        'network',
        'ulogin_uid',
      ],
    ],
    'foreign keys' => [
      'ulogin_identity_user' => [
        'table' => 'users',
        'columns' => [
          'uid' => 'uid',
        ],
      ],
    ],
    'primary key' => [
      'id',
    ],
  ];
  return $schema;
}