function comment_update_7004

7.x comment.install comment_update_7004()

Upgrade the {node_comment_statistics} table.

Related topics

File

drupal-7.x/modules/comment/comment.install, line 220
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'));
  }
}