You are here

function comment_update_7004 in Drupal 7

Upgrade the {node_comment_statistics} table.

Related topics

File

modules/comment/comment.install, line 217
Install, update and uninstall functions for the comment module.

Code

function comment_update_7004() {
  db_add_field('node_comment_statistics', 'cid', array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'description' => 'The {comment}.cid of the last comment.',
  ));
  db_add_index('node_comment_statistics', 'cid', array(
    'cid',
  ));

  // The comment_count index may have been added in Drupal 6.
  if (!db_index_exists('node_comment_statistics', 'comment_count')) {

    // Add an index on the comment_count.
    db_add_index('node_comment_statistics', 'comment_count', array(
      'comment_count',
    ));
  }
}