You are here

function services_client_schema in Services Client 7

Same name and namespace in other branches
  1. 7.2 services_client.install \services_client_schema()

Implementation of hook_schema().

2 calls to services_client_schema()
services_client_uninstall in ./services_client.install
Implementation of hook_uninstall().
services_client_update_7003 in ./services_client.install
Add ctools support and move data around

File

./services_client.install, line 37
Installation file for services_client module.

Code

function services_client_schema() {
  $schema = array();
  $schema['services_client_connection_hook'] = array(
    'description' => 'Connection hooks',
    'export' => array(
      // Unique key of the connection hooks
      'key' => 'name',
      // Description of key.
      'key name' => 'Primary ID Field for connection hooks',
      // For now, we don't allow to disable this.
      'can disable' => FALSE,
      // Variable name to use in exported code.
      'identifier' => 'connection_hook',
      // Use the same hook as the API name below.
      'default hook' => 'default_services_client_connection_hook_myobj',
      // CTools API implementation.
      'api' => array(
        'owner' => 'services_client',
        'api' => 'default_services_client_connection_hook',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'hid' => array(
        'type' => 'serial',
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'conn_name' => array(
        'description' => 'The name of the connection.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The name of the hook.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => 'The title of the hook.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'hook' => array(
        'description' => 'The name of the hook.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'config' => array(
        'type' => 'text',
        'serialize' => TRUE,
        'description' => 'Services client plugins configuration',
        'object default' => array(
          'mapping' => array(
            'plugin' => '',
            'config' => array(),
          ),
          'condition' => array(
            'plugin' => '',
            'config' => array(),
          ),
        ),
      ),
    ),
    'primary key' => array(
      'hid',
    ),
    'unique key' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['services_client_connection_id'] = array(
    'description' => 'Holds ids of remote clients',
    'export' => array(
      // Connection ID Name
      'key' => 'name',
      // Description of key.
      'key name' => 'Name of the connection',
      // For now, we don't allow to disable this.
      'can disable' => FALSE,
      // Variable name to use in exported code.
      'identifier' => 'connection_id',
      // Use the same hook as the API name below.
      'default hook' => 'default_services_client_connection_id_myobj',
      // CTools API implementation.
      'api' => array(
        'owner' => 'services_client',
        'api' => 'default_services_client_connection_id',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'name' => array(
        'description' => 'The name of the connection.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'services_client_id' => array(
        'description' => 'ID of remote client.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  return $schema;
}