You are here

function ulogin_schema in uLogin (advanced version) 7

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

Implements hook_schema().

1 call to ulogin_schema()
ulogin_update_7001 in ./ulogin.install
Adds ulogin_identity table.

File

./ulogin.install, line 40

Code

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