You are here

function _oauth_common_consumer_schema in OAuth 1.0 7.3

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

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

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

File

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

Code

function _oauth_common_consumer_schema() {
  return array(
    'description' => 'Keys and secrets for OAuth consumers, both those provided by this site and other sites.',
    'fields' => array(
      'csid' => array(
        'type' => 'serial',
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'not null' => TRUE,
      ),
      'key_hash' => array(
        'description' => 'SHA1-hash of consumer_key.',
        'type' => 'char',
        'length' => 40,
        'not null' => TRUE,
      ),
      // Key is a reserved word in MySQL so lets avoid that
      'consumer_key' => array(
        'description' => 'Consumer key.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'secret' => array(
        'description' => 'Consumer secret.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'configuration' => array(
        'description' => 'Consumer configuration',
        'type' => 'text',
        'serialized' => TRUE,
        'size' => 'big',
        'not null' => TRUE,
        'object default' => array(),
      ),
    ),
    'primary key' => array(
      'csid',
    ),
    'indexes' => array(
      'key_hash' => array(
        'key_hash',
      ),
    ),
  );
}