You are here

function og_vocab_schema in OG Vocabulary 7

Same name and namespace in other branches
  1. 6 og_vocab.install \og_vocab_schema()

Implements hook_schema().

File

./og_vocab.install, line 11
Install file for the og_vocab module.

Code

function og_vocab_schema() {
  $schema['og_vocab_relation'] = array(
    'description' => t('Relate groups to vocabularies'),
    'fields' => array(
      'id' => array(
        'description' => 'Primary Key: Unique OG vocab ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'group_type' => array(
        'description' => "The group's entity type.",
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'gid' => array(
        'description' => "The group's unique ID.",
        'type' => 'int',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'vid' => array(
        'description' => 'Vocabulary ID',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'vid',
    ),
    'indexes' => array(
      'id' => array(
        'id',
      ),
    ),
  );
  $schema['og_vocab'] = array(
    'description' => t('Relate Og-vocab settings to bundles'),
    'fields' => array(
      'id' => array(
        'description' => 'Primary Key: Unique OG vocab ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'vid' => array(
        'description' => 'Vocabulary ID',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'entity_type' => array(
        'description' => "On which entity-type the widget should appear.",
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'bundle' => array(
        'description' => "On which bundle the widget should appear.",
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'description' => 'Serialized array with field instance settings.',
        'type' => 'text',
        'serialize' => TRUE,
        'size' => 'big',
      ),
      'field_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => "The name of the field the OG-vocab is associated with.",
      ),
    ),
    'indexes' => array(
      'id' => array(
        'id',
      ),
    ),
  );
  return $schema;
}