summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-02-01 09:09:46 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2012-02-01 09:09:46 -0800
commitdf99795a5d7a2cbaa50c2bedcf6fa8420092ebef (patch)
tree24b84daafda1b6c612528e9827cf8d594de5a3b7 /modules/comment
parentd0dc85e5556b47966fe7f541826be8962d3121a9 (diff)
downloadbrdo-df99795a5d7a2cbaa50c2bedcf6fa8420092ebef.tar.gz
brdo-df99795a5d7a2cbaa50c2bedcf6fa8420092ebef.tar.bz2
Issue #289504 by catch, mikeryan, moshe weitzman: Fixed user_delete() performance: index comment uid columns.
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.install8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 121ec22a1..d4bf76f93 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -165,9 +165,11 @@ function comment_update_7001() {
function comment_update_7002() {
db_rename_table('comments', 'comment');
- // Add user-related indexes.
- db_add_index('comment', 'comment_uid', array('uid'));
- db_add_index('node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
+ // Add user-related indexes. These may already exist from Drupal 6.
+ if (!db_index_exists('comment', 'comment_uid')) {
+ db_add_index('comment', 'comment_uid', array('uid'));
+ db_add_index('node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
+ }
// Create a language column.
db_add_field('comment', 'language', array(