[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/glossary/db/ -> upgrade.php (source)

   1  <?php
   2  
   3  // This file keeps track of upgrades to
   4  // the glossary module
   5  //
   6  // Sometimes, changes between versions involve
   7  // alterations to database structures and other
   8  // major things that may break installations.
   9  //
  10  // The upgrade function in this file will attempt
  11  // to perform all the necessary actions to upgrade
  12  // your older installation to the current version.
  13  //
  14  // If there's something it cannot do itself, it
  15  // will tell you what you need to do.
  16  //
  17  // The commands in here will all be database-neutral,
  18  // using the methods of database_manager class
  19  //
  20  // Please do not forget to use upgrade_set_timeout()
  21  // before any action that may take longer time to finish.
  22  
  23  function xmldb_glossary_upgrade($oldversion) {
  24      global $CFG, $DB, $OUTPUT;
  25  
  26      $dbman = $DB->get_manager();
  27  
  28  
  29      // Moodle v2.2.0 release upgrade line
  30      // Put any upgrade step following this
  31  
  32      if ($oldversion < 2012022000) {
  33  
  34          // Define field approvaldisplayformat to be added to glossary
  35          $table = new xmldb_table('glossary');
  36          $field = new xmldb_field('approvaldisplayformat', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, 'default', 'defaultapproval');
  37  
  38          // Conditionally launch add field approvaldisplayformat
  39          if (!$dbman->field_exists($table, $field)) {
  40              $dbman->add_field($table, $field);
  41          }
  42  
  43          // glossary savepoint reached
  44          upgrade_mod_savepoint(true, 2012022000, 'glossary');
  45      }
  46  
  47      // Moodle v2.3.0 release upgrade line
  48      // Put any upgrade step following this
  49  
  50  
  51      // Moodle v2.4.0 release upgrade line
  52      // Put any upgrade step following this
  53  
  54  
  55      // Moodle v2.5.0 release upgrade line.
  56      // Put any upgrade step following this.
  57  
  58  
  59      // Moodle v2.6.0 release upgrade line.
  60      // Put any upgrade step following this.
  61  
  62      // Moodle v2.7.0 release upgrade line.
  63      // Put any upgrade step following this.
  64  
  65      // Moodle v2.8.0 release upgrade line.
  66      // Put any upgrade step following this.
  67  
  68      return true;
  69  }
  70  
  71  


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1