You are here

function _oauth_common_provider_consumer_schema in OAuth 1.0 6.3

Same name and namespace in other branches
  1. 7.4 oauth_common.install \_oauth_common_provider_consumer_schema()
  2. 7.3 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

2 calls to _oauth_common_provider_consumer_schema()
oauth_common_schema in ./oauth_common.install
Implementation of hook_schema().
_oauth_common_update_6300 in updates/update.6300.inc
This update massively refactors the database.

File

./oauth_common.install, line 178
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,
      ),
    ),
    'primary key' => array(
      'consumer_key',
    ),
    'unique keys' => array(
      'csid' => array(
        'csid',
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
  );
}