mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-57435 core: added additional columns to 'event' table
Part of MDL-55611 epic.
This commit is contained in:
parent
5019e69588
commit
ca622fd9fa
@ -431,9 +431,11 @@
|
||||
<FIELD NAME="repeatid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="modulename" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false"/>
|
||||
<FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="type" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="eventtype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false"/>
|
||||
<FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="timeduration" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="timesort" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
|
||||
<FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
|
||||
<FIELD NAME="uuid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
|
||||
<FIELD NAME="sequence" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
|
||||
@ -449,6 +451,7 @@
|
||||
<INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
|
||||
<INDEX NAME="timestart" UNIQUE="false" FIELDS="timestart"/>
|
||||
<INDEX NAME="timeduration" UNIQUE="false" FIELDS="timeduration"/>
|
||||
<INDEX NAME="type-timesort" UNIQUE="false" FIELDS="type, timesort"/>
|
||||
<INDEX NAME="groupid-courseid-visible-userid" UNIQUE="false" FIELDS="groupid, courseid, visible, userid" COMMENT="used for calendar view"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
|
@ -2639,5 +2639,33 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2017040300.05);
|
||||
}
|
||||
|
||||
if ($oldversion < 2017040300.06) {
|
||||
|
||||
// Define fields to be added to the 'event' table.
|
||||
$table = new xmldb_table('event');
|
||||
$fieldtype = new xmldb_field('type', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, 0, 'instance');
|
||||
$fieldtimesort = new xmldb_field('timesort', XMLDB_TYPE_INTEGER, '10', null, false, null, null, 'timeduration');
|
||||
|
||||
// Conditionally launch add field.
|
||||
if (!$dbman->field_exists($table, $fieldtype)) {
|
||||
$dbman->add_field($table, $fieldtype);
|
||||
}
|
||||
|
||||
// Conditionally launch add field.
|
||||
if (!$dbman->field_exists($table, $fieldtimesort)) {
|
||||
$dbman->add_field($table, $fieldtimesort);
|
||||
}
|
||||
|
||||
// Now, define the index we will be adding.
|
||||
$index = new xmldb_index('type-timesort', XMLDB_INDEX_NOTUNIQUE, array('type', 'timesort'));
|
||||
|
||||
// Conditionally launch add index.
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
|
||||
upgrade_main_savepoint(true, 2017040300.06);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2017040300.05; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2017040300.06; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user