You are here

function themekey_schema in ThemeKey 7

Same name and namespace in other branches
  1. 6.4 themekey.install \themekey_schema()
  2. 6 themekey.install \themekey_schema()
  3. 6.2 themekey.install \themekey_schema()
  4. 6.3 themekey.install \themekey_schema()
  5. 7.3 themekey.install \themekey_schema()
  6. 7.2 themekey.install \themekey_schema()

Implements hook_schema().

File

./themekey.install, line 19
Database schema of

Code

function themekey_schema() {
  $schema = array();
  $schema['themekey_properties'] = array(
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'property' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'operator' => array(
        'type' => 'varchar',
        'length' => 2,
        'not null' => TRUE,
        'default' => '=',
      ),
      'value' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'theme' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'enabled' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'wildcards' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
      'parent' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'enabled_parent_weight' => array(
        'enabled',
        'parent',
        'weight',
      ),
      'parent_weight' => array(
        'parent',
        'weight',
      ),
    ),
  );
  return $schema;
}