You are here

function privatemsg_filter_schema in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 privatemsg_filter/privatemsg_filter.install \privatemsg_filter_schema()
  2. 6 privatemsg_filter/privatemsg_filter.install \privatemsg_filter_schema()
  3. 7.2 privatemsg_filter/privatemsg_filter.install \privatemsg_filter_schema()

Implements hook_schema().

File

privatemsg_filter/privatemsg_filter.install, line 11
install file for privatemsg_filter

Code

function privatemsg_filter_schema() {
  $schema = array();
  $schema['pm_tags'] = array(
    'description' => '{pm_tags} holds the names of tags and their id.',
    'fields' => array(
      'tag_id' => array(
        'description' => 'Tag ID',
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'tag' => array(
        'description' => 'The name of the tag',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'public' => array(
        'description' => 'Defines if a tag is public (visible for all users)',
        'type' => 'int',
        'unsigned' => TRUE,
        'size' => 'tiny',
        'default' => 0,
      ),
      'hidden' => array(
        'type' => 'int',
        'description' => 'Defines if a tag should not be displayed and is usually automatically managed',
        'unsigned' => TRUE,
        'size' => 'tiny',
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'tag_id',
    ),
    'indexes' => array(
      'tag_list' => array(
        'tag_id',
        'tag',
        'public',
      ),
    ),
  );
  $schema['pm_tags_index'] = array(
    'description' => '{pm_tags_index} holds mapping information between tags, threads the users.',
    'fields' => array(
      'tag_id' => array(
        'description' => 'Tag ID',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'uid' => array(
        'description' => 'ID of the user',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'thread_id' => array(
        'description' => 'id of the thread',
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
    ),
    'primary key' => array(
      'tag_id',
      'uid',
      'thread_id',
    ),
    'indexes' => array(
      'thread_tags' => array(
        'uid',
        'thread_id',
      ),
    ),
  );
  return $schema;
}