From b5c8bf7a26465bbc85ce735fde8a1998e394be72 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Sun, 26 Mar 2006 22:57:42 +0000 Subject: [PATCH] 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 fa889fcff35..c25d3e18350 100644 --- a/enrol/authorize/db/postgres7.php +++ b/enrol/authorize/db/postgres7.php @@ -7,7 +7,11 @@ function authorize_upgrade($oldversion=0) { $result = true; - if ($oldversion == 0) { + if (!$tables = $db->MetaColumns($CFG->prefix . 'enrol_authorize')) { + $installfirst = true; + } + + if ($oldversion == 0 || !empty($installfirst)) { modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql"); }