You are here

function domain_alias_schema in Domain Access 7.3

Same name and namespace in other branches
  1. 6.2 domain_alias/domain_alias.install \domain_alias_schema()
  2. 7.2 domain_alias/domain_alias.install \domain_alias_schema()

Implements hook_schema().

File

domain_alias/domain_alias.install, line 13
Provide hostname alias registration for domain records.

Code

function domain_alias_schema() {
  $schema['domain_alias'] = array(
    'description' => 'Domain aliases and patterns for domain entries.',
    'fields' => array(
      'alias_id' => array(
        'type' => 'serial',
        'description' => 'The primary identifier for an alias/pattern.',
        'not null' => TRUE,
      ),
      'domain_id' => array(
        'type' => 'int',
        'description' => 'The related domain entry in the {domain} table.',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'pattern' => array(
        'type' => 'varchar',
        'description' => 'The domain alias/pattern',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'redirect' => array(
        'type' => 'int',
        'description' => 'Indicating whether the alias should be redirected to the main domain.',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'alias_id',
    ),
    'indexes' => array(
      'pattern' => array(
        'pattern',
      ),
      'domain' => array(
        'domain_id',
      ),
    ),
    'foreign_keys' => array(
      'uid' => array(
        'user' => 'uid',
      ),
      'domain_id' => array(
        'domain' => 'domain_id',
      ),
    ),
  );
  return $schema;
}