You are here

function content_theme_update_6101 in Content Theme 6

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

Implementation of hook_update_N().

Adds content node theme ID field and updates table indices.

File

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

Code

function content_theme_update_6101() {
  $ret = array();
  db_drop_primary_key($ret, 'content_theme_node');
  db_add_field($ret, 'content_theme_node', 'ctnid', array(
    'type' => 'serial',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ), array(
    'primary key' => array(
      'ctnid',
    ),
  ));
  db_add_unique_key($ret, 'content_theme_node', 'node_action', array(
    'nid',
    'action',
  ));
  db_add_index($ret, 'content_theme_node', 'list', array(
    'nid',
    'action',
    'theme',
  ));
  return $ret;
}