You are here

function clients_schema in Web Service Clients 7.2

Same name and namespace in other branches
  1. 6.2 clients.install \clients_schema()
  2. 6 clients.install \clients_schema()
  3. 7.3 clients.install \clients_schema()
  4. 7 clients.install \clients_schema()

Implements hook_schema

File

./clients.install, line 10
Install, update and uninstall functions for the Clients module.

Code

function clients_schema() {
  $schema['cache_clients'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['clients_connections'] = array(
    'description' => 'Stores service connection configurations',
    // CTools exportables support:
    'export' => array(
      'key' => 'name',
      'key name' => 'Name',
      'primary key' => 'cid',
      'identifier' => 'connection',
      // Exports will be as $myobj
      'default hook' => 'clients_default_connections',
      // Function hook name.
      'export type string' => 'export_type_label',
      'object factory' => 'clients_connection_unpack_object',
      'export callback' => 'clients_export_object',
      'api' => array(
        'owner' => 'clients',
        'api' => 'clients',
        // Base name for api include files.
        'minimum_version' => 3,
        'current_version' => 3,
      ),
    ),
    'fields' => array(
      'cid' => array(
        'description' => 'The primary identifier for a service connection.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'description' => 'Connection name, must be unique',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'Connection type',
        'type' => 'varchar',
        'length' => 64,
      ),
      'endpoint' => array(
        'description' => 'Connection endpoint',
        'type' => 'varchar',
        'length' => 256,
      ),
      'configuration' => array(
        'description' => 'Connection configuration - serialized',
        'serialize' => TRUE,
        'size' => 'big',
        'type' => 'text',
      ),
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  return $schema;
}