You are here

function services_client_schema in Services Client 7.2

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

Implementation of hook_schema().

2 calls to services_client_schema()
services_client_update_7003 in ./services_client.install
Add ctools support and move data around
services_client_update_7200 in ./services_client.install
Create {services_client_connection_event} table.

File

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

Code

function services_client_schema() {
  $schema = array();
  $schema['services_client_connection_event'] = array(
    'description' => 'Connection events',
    'export' => array(
      // Unique key of the connection hooks
      'key' => 'name',
      'admin_title' => 'title',
      // Description of key.
      'key name' => 'Primary ID Field for connection event',
      // For now, we don't allow to disable this.
      'can disable' => TRUE,
      // Variable name to use in exported code.
      'identifier' => 'connection_event',
      // Name of class that should be initialized
      'object' => 'ServicesClientEvent',
      // Use the same hook as the API name below.
      'default hook' => 'default_services_client_connection_event',
      // CTools API implementation.
      'api' => array(
        'owner' => 'services_client',
        'api' => 'services_client_connection_event',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'eid' => 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,
      ),
      'connection' => 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,
      ),
      'entity_type' => array(
        'description' => 'Entity type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'event' => array(
        'description' => 'Event to which should react.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'plugin' => array(
        'description' => 'Plugin type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'config' => array(
        'type' => 'text',
        'serialize' => TRUE,
        'description' => 'Services client plugins configuration',
        'object default' => array(),
      ),
    ),
    'primary key' => array(
      'eid',
    ),
    '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;
}