You are here

ulogin.install in uLogin (advanced version) 8

Same filename and directory in other branches
  1. 6 ulogin.install
  2. 7 ulogin.install

File

ulogin.install
View source
<?php

/**
 * @file
 * File ulogin.install.
 */

/**
 * Implements hook_uninstall().
 */
function ulogin_uninstall() {
  \Drupal::configFactory()
    ->getEditable('ulogin.settings')
    ->delete();
}

/**
 * Implements hook_schema().
 */
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;
}

Functions

Namesort descending Description
ulogin_schema Implements hook_schema().
ulogin_uninstall Implements hook_uninstall().