You are here

function hybridauth_schema in HybridAuth Social Login 6.2

Same name and namespace in other branches
  1. 7.2 hybridauth.install \hybridauth_schema()
  2. 7 hybridauth.install \hybridauth_schema()

Implements hook_schema().

File

./hybridauth.install, line 99
Install, update and uninstall functions for the HybridAuth module.

Code

function hybridauth_schema() {
  $schema = array();
  $schema['hybridauth_identity'] = array(
    'description' => 'Holds identities from HybridAuth library.',
    'fields' => array(
      'id' => array(
        'description' => 'Unique ID of HybridAuth identity.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The {users}.uid that owns this HybridAuth identity.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'provider' => array(
        'description' => 'The authentication provider for this HybridAuth identity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'provider_identifier' => array(
        'description' => 'The authentication provider UID for this HybridAuth identity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'data' => array(
        'description' => 'A serialized array containing information from HybridAuth library.',
        'type' => 'blob',
        'not null' => TRUE,
        'size' => 'normal',
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
    'unique keys' => array(
      'provider_provider_identifier' => array(
        'provider',
        'provider_identifier',
      ),
    ),
    'foreign keys' => array(
      'hybridauth_identity_user' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  $schema['hybridauth_session'] = array(
    'description' => 'Holds sessions data from HybridAuth library.',
    'fields' => array(
      'uid' => array(
        'description' => 'The {users}.uid that owns this HybridAuth session data.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'data' => array(
        'description' => 'A serialized array containing session data from HybridAuth library.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'medium',
      ),
      'updated' => array(
        'description' => 'The Unix timestamp when the session was saved.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'foreign keys' => array(
      'hybridauth_session_user' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}