You are here

function themekey_schema in ThemeKey 6.2

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

Implements hook_schema().

File

./themekey.install, line 18
Database schema of @author Markus Kalkbrenner | Cocomore AG

Code

function themekey_schema() {
  $schema = array();
  $schema['themekey_paths'] = array(
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'path' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'fit' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'wildcards' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
      'callbacks' => array(
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'path_fit_weight' => array(
        'path',
        'fit',
        'weight',
      ),
    ),
  );
  $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;
}