Permalink
Browse files

Merged from MOODLE_15_STABLE. First time install detection.

  • Loading branch information...
1 parent 0e1baec commit f506249f7031e0779303d8b13bd9c786454d03a6 ethem committed Apr 26, 2006
Showing with 5 additions and 6 deletions.
  1. +5 −6 enrol/authorize/db/postgres7.php
@@ -8,13 +8,12 @@ function enrol_authorize_upgrade($oldversion=0) {
$result = true;
- if (!$tables = $db->MetaColumns($CFG->prefix . 'enrol_authorize')) {
- $installfirst = true;
- }
-
- if ($oldversion == 0 || !empty($installfirst)) { // First time install
+ if ($oldversion == 0) {
+ $result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
+ return $result; // SQL file contains all upgrades.
+ } else if (!in_array($CFG->prefix . 'enrol_authorize', $db->MetaTables('TABLES'))) {
$result = modify_database("$CFG->dirroot/enrol/authorize/db/postgres7.sql");
- return $result; // RETURN, sql file contains last upgrades.
+ return $result; // SQL file contains all upgrades.
}
// Authorize module was installed before. Upgrades must be applied to SQL file.

0 comments on commit f506249

Please sign in to comment.