Merge branch 'MDL-63691_master' of git://github.com/markn86/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 22 Oct 2018 02:45:15 +0000 (10:45 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 22 Oct 2018 02:52:13 +0000 (10:52 +0800)
1  2 
lang/en/role.php
lib/db/access.php
lib/db/upgrade.php
message/classes/api.php
message/tests/api_test.php
message/upgrade.txt
version.php

Simple merge
Simple merge
@@@ -2565,5 -2565,49 +2565,45 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2018101800.00);
      }
  
 -    if ($oldversion < 2018101900.01) {
++    if ($oldversion < 2018102200.00) {
+         // 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);
 -    }
 -
 -    if ($oldversion < 2018101900.02) {
+         // Define table 'message_conversations' to be updated.
+         $table = new xmldb_table('message_conversations');
+         // Remove the unique 'convhash' index, change to null and add a new non unique index.
+         $index = new xmldb_index('convhash', XMLDB_INDEX_UNIQUE, ['convhash']);
+         if ($dbman->index_exists($table, $index)) {
+             $dbman->drop_index($table, $index);
+         }
+         $field = new xmldb_field('convhash', XMLDB_TYPE_CHAR, '40', null, null, null, null, 'name');
+         $dbman->change_field_notnull($table, $field);
+         $index = new xmldb_index('convhash', XMLDB_INDEX_NOTUNIQUE, ['convhash']);
+         if (!$dbman->index_exists($table, $index)) {
+             $dbman->add_index($table, $index);
+         }
 -        upgrade_main_savepoint(true, 2018101900.02);
++        upgrade_main_savepoint(true, 2018102200.00);
+     }
      return true;
  }
Simple merge
Simple merge
@@@ -29,7 -29,7 +29,8 @@@ information provided here is intended e
  * The following methods have been deprecated and should not be used any more:
    - \core_message\api::is_user_blocked()
    - \core_message\api::delete_conversation()
 +  - \core_message\api::is_user_non_contact_blocked()
+   - \core_message\api::create_conversation_between_users()
  * The method \core_message\api::can_delete_conversation() now expects a 'conversationid' to be passed
    as the second parameter.
  * The following web services have been deprecated. Please do not call these any more.
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2018101900.01;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2018101900.03;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2018102200.00;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.