diff --git modules/comment/comment.install modules/comment/comment.install index a896078..3b36a68 100644 --- modules/comment/comment.install +++ modules/comment/comment.install @@ -138,6 +138,28 @@ function comment_update_7004() { } /** + * Create comment Field API bundles. + */ +function comment_update_7005() { + $ret = array(); + + foreach (node_type_get_types() as $info) { + field_attach_create_bundle('comment_node_' . $info->type); + } + return $ret; +} + +/** + * Create user related indexes. + */ +function comment_update_7006() { + $ret = array(); + db_add_index($ret, 'comment', 'comment_uid', array('uid')); + db_add_index($ret, 'node_comment_statistics', 'last_comment_uid', array('last_comment_uid')); + return $ret; +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ @@ -241,10 +263,12 @@ function comment_schema() { 'indexes' => array( 'comment_status_pid' => array('pid', 'status'), 'comment_num_new' => array('nid', 'timestamp', 'status'), + 'comment_uid' => array('uid'), ), 'primary key' => array('cid'), 'foreign keys' => array( 'nid' => array('node' => 'nid'), + 'uid' => array('users' => 'uid'), ), ); @@ -288,23 +312,13 @@ function comment_schema() { 'indexes' => array( 'node_comment_timestamp' => array('last_comment_timestamp'), 'comment_count' => array('comment_count'), + 'last_comment_uid' => array('last_comment_uid'), ), 'foreign keys' => array( 'nid' => array('node' => 'nid'), + 'last_comment_uid' => array('users' => 'uid'), ), ); return $schema; -} - -/** - * Create comment Field API bundles. - */ -function comment_update_7005() { - $ret = array(); - - foreach (node_type_get_types() as $info) { - field_attach_create_bundle('comment_node_' . $info->type); - } - return $ret; } \ No newline at end of file