You are here

function services_schema in Services 6

Same name and namespace in other branches
  1. 6.3 services.install \services_schema()
  2. 6.2 services.install \services_schema()
  3. 7.3 services.install \services_schema()
  4. 7 services.install \services_schema()

Implementation of hook_schema().

File

./services.install, line 11
@author Services Dev Team

Code

function services_schema() {
  $schema['services_keys'] = array(
    'description' => 'Stores all Service keys.',
    'fields' => array(
      'kid' => array(
        'description' => 'The service key ID.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'title' => array(
        'description' => 'The title of the service key.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'domain' => array(
        'description' => 'The domain of the service key.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'kid',
    ),
  );
  $schema['services_timestamp_nonce'] = array(
    'description' => 'Stores timestamp against nonce for repeat attacks.',
    'fields' => array(
      'timestamp' => array(
        'description' => 'The timestamp used with the Nonce.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'nonce' => array(
        'description' => 'The random string used on the request.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'domain' => array(
        'description' => 'The domain that submitted the request.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'timestamp' => array(
        'timestamp',
      ),
    ),
    'primary key' => array(
      'nonce',
    ),
  );
  return $schema;
}