diff --git a/lib/db/install.xml b/lib/db/install.xml index e106f9c18fa..39761379cb0 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -650,6 +650,20 @@ + + + + + + + + + + + + + +
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 51d51572fbb..851b7fdacd4 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2753,5 +2753,31 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2019030100.01); } + if ($oldversion < 2019030800.00) { + // Define table 'message_conversation_actions' to be created. + // Note - I would have preferred 'message_conversation_user_actions' but due to Oracle we can't. Boo. + $table = new xmldb_table('message_conversation_actions'); + + // Adding fields to table 'message_conversation_actions'. + $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); + $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); + $table->add_field('conversationid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); + $table->add_field('action', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); + $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); + + // Adding keys to table 'message_conversation_actions'. + $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); + $table->add_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + $table->add_key('conversationid', XMLDB_KEY_FOREIGN, ['conversationid'], 'message_conversations', ['id']); + + // Conditionally launch create table for 'message_conversation_actions'. + if (!$dbman->table_exists($table)) { + $dbman->create_table($table); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2019030800.00); + } + return true; } diff --git a/version.php b/version.php index acfa8ec784c..a1bca9e9aee 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2019030700.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2019030800.00; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.