You are here

function oembed_schema in oEmbed 7

Same name and namespace in other branches
  1. 7.0 oembed.install \oembed_schema()

Implements hook_schema().

File

./oembed.install, line 11
Install, update and uninstall functions for the oEmbed module.

Code

function oembed_schema() {
  $schema['oembed_provider'] = array(
    'export' => array(
      'identifier' => 'provider',
      'primary key' => 'pid',
      'bulk export' => TRUE,
      'default hook' => 'default_oembed_provider',
      'api' => array(
        'owner' => 'oembed',
        'api' => 'oembed_provider',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'pid' => array(
        'type' => 'serial',
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'Unique ID for this subtask. Used to identify it programmatically.',
        'not null' => TRUE,
        'default' => '',
      ),
      'title' => array(
        'description' => 'The human-readable title of the provider.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'endpoint' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'The endpoint for this provider.',
        'not null' => TRUE,
        'default' => '',
      ),
      'scheme' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Line separated scheme definition.',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => '',
      ),
    ),
    'primary key' => array(
      'pid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['cache_oembed'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_oembed']['description'] = 'Cache table for the oEmbed module.';
  return $schema;
}