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
This commit is contained in:
skodak 2006-07-31 17:54:32 +00:00
parent d9d69929f5
commit 365525fc51

View 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