You are here

function gauth_schema in Google Auth 7

Same name and namespace in other branches
  1. 7.2 gauth.install \gauth_schema()

Implements hook_schema().

File

./gauth.install, line 10
Install and uninstall functions for the Google OAuth module.

Code

function gauth_schema() {
  $schema['gauth_accounts'] = array(
    'description' => 'Google OAuth2 api information.',
    'fields' => array(
      'id' => array(
        'description' => 'A unique identifier for the google api.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The account name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'developer_key' => array(
        'description' => 'The api key for Google Access.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'client_id' => array(
        'description' => 'The Client Id of Google Account.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'client_secret' => array(
        'description' => 'The Client Secret Id of Google Account.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'services' => array(
        'description' => 'The OAuth account is used for which services.',
        'type' => 'text',
      ),
      'access_token' => array(
        'description' => 'The OAuth access token.',
        'type' => 'text',
      ),
      'access_type' => array(
        'description' => 'Stores the access type of the account',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'offline',
      ),
      'is_authenticated' => array(
        'description' => 'Is the account authenticated and ready to use?.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The users uid of the user who created the gauth account.',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['cache_gauth_scopes'] = drupal_get_schema_unprocessed('system', 'cache');
  return $schema;
}