From: martinlanghoff Date: Thu, 25 Nov 2004 00:02:58 +0000 (+0000) Subject: Merged form MOODLE_14_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=71dcd6c0147b8331324f08bb443b00f2094cf7ca;p=moodle.git Merged form MOODLE_14_STABLE Fixed an issue with postgres database upgrade code -- drop either index or constraint if they exist Merge of patchset arch-eduforge@catalyst.net.nz--2004/moodle--eduforge--1.3.3--patch-430 --- diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index acf7e94db3..2401f41855 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -768,6 +768,7 @@ function main_upgrade($oldversion=0) { // odd! username was missing its unique index! // first silently drop it just in case... + execute_sql("ALTER TABLE {$CFG->prefix}user DROP CONSTRAINT {$CFG->prefix}user_username_uk;", false); execute_sql("DROP INDEX {$CFG->prefix}user_username_uk", false); modify_database('', "CREATE UNIQUE INDEX prefix_user_username_uk ON prefix_user (username);");