You are here

function services_schema in Services 6.3

Same name and namespace in other branches
  1. 6 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 10
Install, uninstall and update the Services module.

Code

function services_schema() {
  $schema = array();
  $schema['services_endpoint'] = array(
    'description' => 'Stores endpoint information for services',
    '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,
      ),
      'name' => array(
        'description' => 'The name of the endpoint.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'server' => array(
        'description' => 'The name of the server used in this endpoint.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'The path to the endpoint for this server.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'authentication' => array(
        'description' => 'The authentication settings for the endpoint.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
      'server_settings' => array(
        'description' => 'The server settings for the endpoint.',
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
      'resources' => array(
        'description' => 'Information about the resources exposed in this endpoint.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
      'debug' => array(
        'description' => 'Set the endpoint in debug mode.',
        'type' => 'int',
        'length' => 2,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'eid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
    'export' => array(
      'key' => 'name',
      'identifier' => 'endpoint',
      'primary key' => 'name',
      'api' => array(
        'owner' => 'services',
        'api' => 'services',
        'minimum_version' => 3,
        'current_version' => 3,
      ),
    ),
  );
  return $schema;
}