Merge branch 'MDL-31973-master-6' of git://git.luns.net.uk/moodle

Conflicts:
	lib/db/upgrade.php
This commit is contained in:
Eloy Lafuente (stronk7) 2012-08-29 00:42:43 +02:00
commit 238f7761af
14 changed files with 161 additions and 7 deletions

View file

@ -2097,7 +2097,9 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="groupid"/>
<FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupid" NEXT="timeadded"/>
<FIELD NAME="timeadded" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid"/>
<FIELD NAME="timeadded" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="component"/>
<FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" COMMENT="Defines the Moodle component which added this group membership (e.g. 'auth_myplugin'), or blank if it was added manually. (Entries which are created by a Moodle component cannot be removed in the normal user interface.)" PREVIOUS="timeadded" NEXT="itemid"/>
<FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="If the 'component' field is set, this can be used to define the instance of the component that created the entry. Otherwise should be left as default (0)." PREVIOUS="component"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="groupid"/>
@ -2864,4 +2866,4 @@
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
</XMLDB>

View file

@ -1162,6 +1162,27 @@ function xmldb_main_upgrade($oldversion) {
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;
}