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
This commit is contained in:
martinlanghoff 2004-11-25 00:02:58 +00:00
parent 8eb1e7ff81
commit 71dcd6c014

View File

@ -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);");