From: mjollnir_ Date: Sun, 26 Mar 2006 22:59:23 +0000 (+0000) Subject: Merged from MOODLE_15_STABLE: Since there was no pg support for enrol/authorize until... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=742104c531a9a04ee060280108e1bb48c18e3703;p=moodle.git Merged from MOODLE_15_STABLE: Since there was no pg support for enrol/authorize until later, the versioning was screwey in postgres, so check the table exists first before trying to add columns to it, create it if it is not there --- diff --git a/enrol/authorize/db/postgres7.php b/enrol/authorize/db/postgres7.php index ee4e4fd2a3..e206da11cf 100644 --- a/enrol/authorize/db/postgres7.php +++ b/enrol/authorize/db/postgres7.php @@ -8,7 +8,11 @@ function enrol_authorize_upgrade($oldversion=0) { $result = true; - if ($oldversion == 0) { // First time install + if (!$tables = $db->MetaColumns($CFG->prefix . 'enrol_authorize')) { + $installfirst = true; + } + + if ($oldversion == 0 || !empty($installfirst)) { // First time install $result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql"); return $result; // RETURN, sql file contains last upgrades. }