You are here

function content_theme_schema in Content Theme 6

Same name and namespace in other branches
  1. 7.2 content_theme.install \content_theme_schema()
  2. 7 content_theme.install \content_theme_schema()

Implementation of hook_schema().

File

./content_theme.install, line 12
Install, update and uninstall functions for the content_theme module.

Code

function content_theme_schema() {
  $schema = array();
  $schema['content_theme_node'] = array(
    'description' => 'Stores assigned themes when creating, editing, or viewing content.',
    'fields' => array(
      'ctnid' => array(
        'description' => 'Primary Key: Unique content node theme ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'Node id to which the theme is assigned.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'action' => array(
        'description' => 'Node action to which the theme is assigned.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'theme' => array(
        'description' => 'Theme name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'ctnid',
    ),
    'unique keys' => array(
      'node_action' => array(
        'nid',
        'action',
      ),
    ),
    'indexes' => array(
      'list' => array(
        'nid',
        'action',
        'theme',
      ),
    ),
  );
  return $schema;
}