function services_schema in Services 7.3
Same name and namespace in other branches
- 6.3 services.install \services_schema()
- 6 services.install \services_schema()
- 6.2 services.install \services_schema()
- 7 services.install \services_schema()
Implements 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',
'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,
),
),
);
$schema['services_user'] = array(
'description' => 'Stores users created/updated by services.',
'fields' => array(
'uid' => array(
'type' => 'int',
'description' => 'User id that has been created by Drupal',
'unsigned' => TRUE,
'not null' => TRUE,
),
'created' => array(
'description' => 'The Unix timestamp when the node was most recently created by services.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'changed' => array(
'description' => 'The Unix timestamp when the user was most recently updated by services.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'uid',
),
);
return $schema;
}