From 742104c531a9a04ee060280108e1bb48c18e3703 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Sun, 26 Mar 2006 22:59:23 +0000 Subject: [PATCH] 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 --- enrol/authorize/db/postgres7.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. } -- 2.39.5