You are here

function page_theme_schema in Page Theme 7.2

Same name and namespace in other branches
  1. 6 page_theme.install \page_theme_schema()
  2. 7 page_theme.install \page_theme_schema()

Implements hook_schema().

File

./page_theme.install, line 24
Install, update and uninstall functions for the page_theme module.

Code

function page_theme_schema() {
  $schema['page_theme'] = array(
    'description' => 'Stores page theme rules.',
    'fields' => array(
      'ptid' => array(
        'description' => 'Primary Key: Unique rule ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'rule' => array(
        'description' => 'Rule machine-name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'name' => array(
        'description' => 'Rule name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'theme' => array(
        'description' => 'Theme name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'pages' => array(
        'description' => 'List of paths to which the theme is assigned.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'status' => array(
        'description' => 'Rule enabled status. (1 = enabled, 0 = disabled)',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'description' => 'Rule weight within the rule list.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'ptid',
    ),
    'unique keys' => array(
      'rule' => array(
        'rule',
      ),
    ),
    'indexes' => array(
      'list' => array(
        'weight',
        'rule',
      ),
    ),
  );
  $schema['page_theme_role'] = array(
    'description' => 'Sets up access permissions for page theme rules based on user roles',
    'fields' => array(
      'ptid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => "The page theme's rule ID from {page_theme}.ptid.",
      ),
      'rid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => "The user's role ID from {users_roles}.rid.",
      ),
    ),
    'primary key' => array(
      'ptid',
      'rid',
    ),
    'indexes' => array(
      'rid' => array(
        'rid',
      ),
    ),
  );
  return $schema;
}