diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-09-29 15:13:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-09-29 15:13:57 +0000 |
commit | cef10893892a1c40f73fd972969c3512b0983cd6 (patch) | |
tree | c295a5dea1cc8f5d0ced7e7c967c70cf34f33c73 /modules/comment/comment.install | |
parent | 0a0b067c2404b041454cc7a5fc8cfbbb9ecd6027 (diff) | |
download | brdo-cef10893892a1c40f73fd972969c3512b0983cd6.tar.gz brdo-cef10893892a1c40f73fd972969c3512b0983cd6.tar.bz2 |
- Patch #570900 by Crell | asimmonds: Changed Destroy remnants of update_sql().
Diffstat (limited to 'modules/comment/comment.install')
-rw-r--r-- | modules/comment/comment.install | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 1b63d4aa3..300534544 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -58,40 +58,42 @@ function comment_update_7000() { foreach ($types as $type => $object) { variable_del('comment_default_order' . $type); } - return array(array('success' => TRUE, 'query' => 'Comment order settings removed.')); + return t('Comment order settings removed.'); } /** * Change comment status from published being 0 to being 1 */ function comment_update_7001() { - $ret = array(); - $ret[] = update_sql("UPDATE {comments} SET status = 3 WHERE status = 0"); - $ret[] = update_sql("UPDATE {comments} SET status = 0 WHERE status = 1"); - $ret[] = update_sql("UPDATE {comments} SET status = 1 WHERE status = 3"); + $changes = array( + 3 => 0, + 0 => 1, + 1 => 3, + ); - return $ret; + foreach ($changes as $old => $new) { + db_update('comments') + ->fields(array('status', $new)) + ->condition('status', $old) + ->execute(); + } } /** * Rename {comments} table to {comment}. */ function comment_update_7002() { - $ret = array(); - db_rename_table($ret, 'comments', 'comment'); - return $ret; + db_rename_table('comments', 'comment'); } /** * Improve indexes on the comment table. */ function comment_update_7003() { - $ret = array(); - db_drop_index($ret, 'comment', 'status'); - db_drop_index($ret, 'comment', 'pid'); - db_add_index($ret, 'comment', 'comment_pid_status', array('pid', 'status')); - db_add_index($ret, 'comment', 'comment_num_new', array('nid', 'timestamp', 'status')); - return $ret; + db_drop_index('comment', 'status'); + db_drop_index('comment', 'pid'); + db_add_index('comment', 'comment_pid_status', array('pid', 'status')); + db_add_index('comment', 'comment_num_new', array('nid', 'timestamp', 'status')); } /** @@ -108,29 +110,23 @@ function comment_update_7004() { variable_set('comment_default_mode_' . $type, 0); } } - return array(); } /** * 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; + db_add_index('comment', 'comment_uid', array('uid')); + db_add_index('node_comment_statistics', 'last_comment_uid', array('last_comment_uid')); } /** |