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

This commit is contained in:
mjollnir_ 2006-03-26 22:59:23 +00:00
parent 8cf1d8949e
commit 742104c531

View file

@ -8,7 +8,11 @@ function enrol_authorize_upgrade($oldversion=0) {
$result = true; $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"); $result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
return $result; // RETURN, sql file contains last upgrades. return $result; // RETURN, sql file contains last upgrades.
} }