From efaf4d23bb6d775441507b209427872a8706fe42 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Sat, 10 Dec 2005 08:13:40 +0000
Subject: [PATCH] - Patch #36042 by Cvbge: make the latest database upgrade
 work with PostgreSQL.

---
 database/updates.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/database/updates.inc b/database/updates.inc
index d1fbbddbc735..b1aa202862b3 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -1109,6 +1109,8 @@ function system_update_158() {
       break;
 
     case 'pgsql':
+      db_add_column($ret, 'old_revisions', 'done', 'smallint', array('not null' => TRUE, 'default' => 0));
+      $ret[] = update_sql('CREATE INDEX {old_revisions}_done_idx ON {old_revisions}(done)');
       break;
   }
 
@@ -1207,9 +1209,11 @@ function system_update_159() {
       break;
 
     case 'pgsql':
+      $ret[] = update_sql("SELECT setval('{node_revisions}_vid_seq', $vid)");
       break;
   }
 
+  // FIXME - wrong - allways will be true? (limit was 20)
   if (db_num_rows($result) < 50) {
     $ret[] = update_sql('ALTER TABLE {old_revisions} DROP done');
   }
-- 
GitLab