Merge branch 'MDL-31973-master-6' of git://git.luns.net.uk/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 28 Aug 2012 22:42:43 +0000 (00:42 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 28 Aug 2012 22:42:43 +0000 (00:42 +0200)
Conflicts:
lib/db/upgrade.php

1  2 
backup/moodle2/backup_stepslib.php
backup/moodle2/restore_stepslib.php
lib/db/install.xml
lib/db/upgrade.php

Simple merge
Simple merge
Simple merge
@@@ -1120,48 -1120,26 +1120,69 @@@ function xmldb_main_upgrade($oldversion
      }
  
      if ($oldversion < 2012082300.01) {
 -        upgrade_main_savepoint(true, 2012082300.01);
 +        // Add more custom enrol fields.
 +        $table = new xmldb_table('enrol');
 +
 +        $field = new xmldb_field('customint5', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint4');
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        $field = new xmldb_field('customint6', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint5');
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        $field = new xmldb_field('customint7', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint6');
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        $field = new xmldb_field('customint8', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint7');
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        $field = new xmldb_field('customchar3', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'customchar2');
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        $field = new xmldb_field('customtext3', XMLDB_TYPE_TEXT, null, null, null, null, null, 'customtext2');
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        $field = new xmldb_field('customtext4', XMLDB_TYPE_TEXT, null, null, null, null, null, 'customtext3');
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2012082300.01);
 +    }
 +
++    if ($oldversion < 2012082300.02) {
+         // Define field component to be added to groups_members
+         $table = new xmldb_table('groups_members');
+         $field = new xmldb_field('component', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, 'timeadded');
+         // Conditionally launch add field component
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Define field itemid to be added to groups_members
+         $field = new xmldb_field('itemid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'component');
+         // Conditionally launch add field itemid
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Main savepoint reached
++        upgrade_main_savepoint(true, 2012082300.02);
+     }
  
      return true;
  }