From: skodak Date: Mon, 31 Jul 2006 17:54:32 +0000 (+0000) Subject: Bug #6147 - Upgrade from 1.5.x breaks with Postgres 7.4.x X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=365525fc51146c722d12392f674304d4001e366a;p=moodle.git Bug #6147 - Upgrade from 1.5.x breaks with Postgres 7.4.x 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 --- diff --git a/backup/db/postgres7.php b/backup/db/postgres7.php index 0ddafc5b7d..3afe71539c 100644 --- a/backup/db/postgres7.php +++ b/backup/db/postgres7.php @@ -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