You are here

function _oauth_common_provider_consumer_schema in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 oauth_common.install \_oauth_common_provider_consumer_schema()
  2. 7.4 oauth_common.install \_oauth_common_provider_consumer_schema()

Contains the provider consumer schema - used by oauth_common_schema() as well as latest related update function

1 call to _oauth_common_provider_consumer_schema()
oauth_common_schema in ./oauth_common.install
Implements hook_schema().

File

./oauth_common.install, line 177
Installation and schema related functions for the OAuth module

Code

function _oauth_common_provider_consumer_schema() {
  return array(
    'description' => 'Additional data for OAuth consumers provided by this site.',
    'fields' => array(
      'csid' => array(
        'description' => 'The {oauth_common_consumer}.csid this data is related to.',
        'type' => 'int',
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'consumer_key' => array(
        'description' => 'Consumer key.',
        // This is our own internal key - it's always 32 characters long
        'type' => 'char',
        'length' => 32,
        'not null' => TRUE,
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The time that the consumer was created, as a Unix timestamp.',
      ),
      'changed' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The last time the consumer was edited, as a Unix timestamp.',
      ),
      'uid' => array(
        'description' => 'The application owner.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The application name.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'context' => array(
        'description' => 'The application context.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'callback_url' => array(
        'description' => 'Callback URL.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'consumer_key',
    ),
    'unique keys' => array(
      'csid' => array(
        'csid',
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
    'foreign keys' => array(
      'oauth_common_consumer' => array(
        'table' => 'oauth_common_consumer',
        'columns' => array(
          'csid' => 'csid',
        ),
      ),
      'users' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
  );
}