You are here

function forum_access_schema in Forum Access 6

Same name and namespace in other branches
  1. 8 forum_access.install \forum_access_schema()
  2. 7 forum_access.install \forum_access_schema()

Implementation of hook_schema().

File

./forum_access.install, line 42
Install, update and uninstall functions for the forum_access module.

Code

function forum_access_schema() {
  $schema['forum_access'] = array(
    'description' => 'The base Forum Access Control table.',
    'fields' => array(
      'tid' => array(
        'description' => 'The {term_data}.tid to which this {forum_access} entry applies.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'rid' => array(
        'description' => 'The {role}.rid to which this {forum_access} entry applies.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'grant_view' => array(
        'description' => 'Whether to grant "view" permission.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'grant_update' => array(
        'description' => 'Whether to grant "update" permission.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'grant_delete' => array(
        'description' => 'Whether to grant "delete" permission.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'grant_create' => array(
        'description' => 'Whether to grant "create" permission.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'priority' => array(
        'description' => 'The priority of this grant.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'tid' => array(
        'tid',
      ),
      'rid' => array(
        'rid',
      ),
    ),
  );
  return $schema;
}