Merge branch 'MDL-54751-master-v5' of https://github.com/snake/moodle

This commit is contained in:
David Monllao 2016-11-07 08:55:44 +08:00
commit 90abff01b3
25 changed files with 725 additions and 25 deletions

View file

@ -300,6 +300,7 @@
<FIELD NAME="completionexpected" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Date at which students are expected to complete this activity. This field is used when displaying student progress."/>
<FIELD NAME="showdescription" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Some module types support a 'description' which shows within the module pages. This option controls whether it also displays on the course main page. 0 = does not display (default), 1 = displays"/>
<FIELD NAME="availability" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Availability restrictions for viewing this activity, in JSON format. Null if no restrictions."/>
<FIELD NAME="deletioninprogress" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>

View file

@ -2392,5 +2392,19 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2016110500.00);
}
if ($oldversion < 2016110600.00) {
// Define a field 'deletioninprogress' in the 'course_modules' table, to background deletion tasks.
$table = new xmldb_table('course_modules');
$field = new xmldb_field('deletioninprogress', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'availability');
// Conditionally launch add field 'deletioninprogress'.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2016110600.00);
}
return true;
}