You are here

function auth0_schema in Auth0 Single Sign On 8.2

Same name and namespace in other branches
  1. 8 auth0.install \auth0_schema()
  2. 7.2 auth0.install \auth0_schema()

Implements hook_schema().

File

./auth0.install, line 11
Installation file for the auth0 module.

Code

function auth0_schema() {
  $schema['auth0_user'] = array(
    'description' => 'Joins Auth0 users with Drupal users.',
    'fields' => array(
      'auth0_id' => array(
        'description' => 'The user id on Auth0',
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
      ),
      'drupal_id' => array(
        'description' => 'The user id on Drupal',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'auth0_object' => array(
        'description' => 'A serialized version of the Auth0 user',
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'indexes' => array(
      'drupal_id' => [
        'drupal_id',
      ],
    ),
    'primary key' => [
      'auth0_id',
    ],
  );
  return $schema;
}