From: skodak Date: Mon, 31 Jul 2006 18:04:10 +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=889e6b46f48e0d63bf016befdc08cedf6bd97b20;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/lib/db/postgres7.php b/lib/db/postgres7.php index 6d5c8d0c49..359a03652c 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -1544,18 +1544,14 @@ function main_upgrade($oldversion=0) { } } - modify_database('', 'ALTER TABLE prefix_course_request - ALTER COLUMN "password" TYPE varchar(50), - ALTER COLUMN "password" SET DEFAULT \'\''); + table_column('course_request', 'password', 'password', 'varchar', '50', '', ''); - modify_database('', 'ALTER TABLE prefix_course - ALTER COLUMN currency TYPE varchar(3)'); + table_column('course', 'currency', 'currency', 'varchar', '3'); modify_database('', 'ALTER TABLE prefix_course_categories ALTER COLUMN path SET DEFAULT \'\''); - modify_database('', 'ALTER TABLE prefix_log_display - ALTER COLUMN module TYPE varchar(20)'); + table_column('log_display', 'module', 'module', 'varchar', '20'); modify_database("","DROP INDEX id_user_idx"); modify_database("","DROP INDEX post_lastmodified_idx");