MDL-63691 core: updated 'message_conversations' table
This commit is contained in:
@@ -616,6 +616,8 @@
|
||||
<TABLE NAME="message_conversations" COMMENT="Stores all message conversations">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
|
||||
<FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
|
||||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
|
||||
<FIELD NAME="convhash" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false"/>
|
||||
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
|
||||
</FIELDS>
|
||||
@@ -623,6 +625,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="type" UNIQUE="false" FIELDS="type"/>
|
||||
<INDEX NAME="convhash" UNIQUE="true" FIELDS="convhash"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
|
||||
@@ -2565,5 +2565,28 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2018101800.00);
|
||||
}
|
||||
|
||||
if ($oldversion < 2018101900.01) {
|
||||
// Add field 'type' to 'message_conversations'.
|
||||
$table = new xmldb_table('message_conversations');
|
||||
$field = new xmldb_field('type', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 1, 'id');
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
// Add field 'name' to 'message_conversations'.
|
||||
$field = new xmldb_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'type');
|
||||
if (!$dbman->field_exists($table, $field)) {
|
||||
$dbman->add_field($table, $field);
|
||||
}
|
||||
|
||||
// Conditionally launch add index 'type'.
|
||||
$index = new xmldb_index('type', XMLDB_INDEX_NOTUNIQUE, ['type']);
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
|
||||
upgrade_main_savepoint(true, 2018101900.01);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2018101900.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2018101900.01; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user