You are here

function shorten_cs_schema in Shorten URLs 8

Same name and namespace in other branches
  1. 8.2 modules/shorten_cs/shorten_cs.install \shorten_cs_schema()
  2. 6 shorten_cs.install \shorten_cs_schema()
  3. 7.2 shorten_cs.install \shorten_cs_schema()
  4. 7 shorten_cs.install \shorten_cs_schema()

Implements hook_schema().

File

modules/shorten_cs/shorten_cs.install, line 11
(Un)installs the Shorten URLs Custom Services module.

Code

function shorten_cs_schema() {
  $schema = array();
  $schema['shorten_cs'] = array(
    'description' => 'Stores custom services for the Shorten URLs module.',
    'fields' => array(
      'sid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => 'The Service ID.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 190,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The name of the URL shortening service.',
      ),
      'url' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The API endpoint URL.',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The type of API response.',
      ),
      'tag' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The XML tag or JSON key identifying the shortened URL from the API response, if applicable.',
      ),
    ),
    'indexes' => array(),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
    'primary key' => array(
      'sid',
    ),
  );
  return $schema;
}