summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/comment/comment.install17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 344aa333e..412c8fc05 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -120,17 +120,20 @@ function comment_update_7000() {
* Change comment status from published being 0 to being 1
*/
function comment_update_7001() {
+ // Choose a temporary status value different from the existing status values.
+ $tmp_status = db_query('SELECT MAX(status) FROM {comments}')->fetchField() + 1;
+
$changes = array(
- 3 => 0,
- 0 => 1,
- 1 => 3,
+ 0 => $tmp_status,
+ 1 => 0,
+ $tmp_status => 1,
);
foreach ($changes as $old => $new) {
- db_update('comments')
- ->fields(array('status' => $new))
- ->condition('status', $old)
- ->execute();
+ db_update('comments')
+ ->fields(array('status' => $new))
+ ->condition('status', $old)
+ ->execute();
}
}