Commit efaf4d23 authored by Dries's avatar Dries
Browse files

- Patch #36042 by Cvbge: make the latest database upgrade work with PostgreSQL.

parent 2659fadd
...@@ -1109,6 +1109,8 @@ function system_update_158() { ...@@ -1109,6 +1109,8 @@ function system_update_158() {
break; break;
case 'pgsql': 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; break;
} }
...@@ -1207,9 +1209,11 @@ function system_update_159() { ...@@ -1207,9 +1209,11 @@ function system_update_159() {
break; break;
case 'pgsql': case 'pgsql':
$ret[] = update_sql("SELECT setval('{node_revisions}_vid_seq', $vid)");
break; break;
} }
// FIXME - wrong - allways will be true? (limit was 20)
if (db_num_rows($result) < 50) { if (db_num_rows($result) < 50) {
$ret[] = update_sql('ALTER TABLE {old_revisions} DROP done'); $ret[] = update_sql('ALTER TABLE {old_revisions} DROP done');
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment