diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 120467f..45e7b3e 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -222,8 +222,11 @@ function comment_update_7004() { )); db_add_index('node_comment_statistics', 'cid', array('cid')); - // Add an index on the comment_count. - db_add_index('node_comment_statistics', 'comment_count', array('comment_count')); + // 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')); + } } /**