Merge branch 'MDL-49543' of https://github.com/totara/openbadges
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 25 Mar 2015 00:32:34 +0000 (01:32 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 25 Mar 2015 00:32:34 +0000 (01:32 +0100)
1  2 
lib/db/upgrade.php

@@@ -4247,10 -4247,23 +4247,28 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2015031400.00);
      }
  
 +    if ($oldversion < 2015031900.01) {
 +        unset_config('crontime', 'registration');
 +        upgrade_main_savepoint(true, 2015031900.01);
 +    }
 +
+     if ($oldversion < 2015032000.00) {
+         $table = new xmldb_table('badge_criteria');
+         $field = new xmldb_field('description', XMLDB_TYPE_TEXT, null, null, null, null, null);
+         // Conditionally add description field to the badge_criteria table.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         $field = new xmldb_field('descriptionformat', XMLDB_TYPE_INTEGER, 2, null, XMLDB_NOTNULL, null, 0);
+         // Conditionally add description format field to the badge_criteria table.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         upgrade_main_savepoint(true, 2015032000.00);
+     }
      return true;
  }