You are here

function permissions_by_term_schema in Permissions by Term 7

Same name and namespace in other branches
  1. 8.2 permissions_by_term.install \permissions_by_term_schema()
  2. 8 permissions_by_term.install \permissions_by_term_schema()

Implements hook_schema().

File

./permissions_by_term.install, line 10
Install, update and uninstall functions for the permissions_by_term module.

Code

function permissions_by_term_schema() {
  $schema = array();

  // Specifications for tabe 'permissions_by_term_user'
  $schema['permissions_by_term_user'] = array(
    'description' => "Stores the tid's to which a user has permission by his uid.",
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'tid',
      'uid',
    ),
  );

  // Specifications for tabe 'permissions_by_term_role'
  $schema['permissions_by_term_role'] = array(
    'description' => "Stores the tid's to which user's are allowed to by rid.",
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'rid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'tid',
      'rid',
    ),
  );
  return $schema;
}