]> git.mjollnir.org Git - moodle.git/commitdiff
Bug #6147 - Upgrade from 1.5.x breaks with Postgres 7.4.x
authorskodak <skodak>
Mon, 31 Jul 2006 17:54:32 +0000 (17:54 +0000)
committerskodak <skodak>
Mon, 31 Jul 2006 17:54:32 +0000 (17:54 +0000)
Even though Postgres 7.4.x is officially supported, several upgrade scripts use syntax that only works in Postgres 8.x. and it's impossible to finish the upgrade.

The attached patch fixes those scripts.

Saludos. I�aki.

Author: I�aki Arenaza
Review: Jun Yamog, Martin Langhoff

merged from MOODLE_16_STABLE

backup/db/postgres7.php

index 0ddafc5b7dc401732b5b0d866bc5b190a40934ef..3afe71539ce2a38340a56e50100f45aae5e4d98b 100644 (file)
@@ -51,24 +51,14 @@ function backup_upgrade($oldversion=0) {
     }
 
     if ($oldversion < 2006042801) {
-        modify_database('', 'ALTER TABLE prefix_backup_log
-            ALTER COLUMN "time" TYPE integer,
-            ALTER COLUMN "time" SET DEFAULT 0,
-            ALTER COLUMN laststarttime TYPE integer,
-            ALTER COLUMN laststarttime SET DEFAULT 0,
-            ALTER COLUMN courseid TYPE integer,
-            ALTER COLUMN courseid SET DEFAULT 0');
-
-        modify_database('', 'ALTER TABLE mdl_backup_courses
-            ALTER COLUMN lastendtime TYPE integer,
-            ALTER COLUMN lastendtime SET DEFAULT 0,
-            ALTER COLUMN laststarttime TYPE integer,
-            ALTER COLUMN laststarttime SET DEFAULT 0,
-            ALTER COLUMN courseid TYPE integer,
-            ALTER COLUMN courseid SET DEFAULT 0,
-            ALTER COLUMN nextstarttime TYPE integer,
-            ALTER COLUMN nextstarttime SET DEFAULT 0');
+        table_column('backup_log', 'time', 'time', 'integer', '', '', '0');
+        table_column('backup_log', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
+        table_column('backup_log', 'courseid', 'courseid', 'integer', '', '', '0');
 
+        table_column('backup_courses', 'lastendtime', 'lastendtime', 'integer', '', '', '0');
+        table_column('backup_courses', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
+        table_column('backup_courses', 'courseid', 'courseid', 'integer', '', '', '0');
+        table_column('backup_courses', 'nextstarttime', 'nextstarttime', 'integer', '', '', '0');
     }
 
     //Finally, return result