Merge branch 'MDL-36941_master-fix' of git://github.com/markn86/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 28 Mar 2018 15:39:40 +0000 (17:39 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 28 Mar 2018 16:42:18 +0000 (18:42 +0200)
iplookup/tests/geoip_test.php
lib/db/upgrade.php
message/output/popup/db/install.xml [new file with mode: 0644]
message/output/popup/db/upgrade.php

index de399fe..b65be59 100644 (file)
@@ -122,7 +122,7 @@ class core_iplookup_geoip_testcase extends advanced_testcase {
     public function ip_provider() {
         return [
             'IPv4: Sample suggested by maxmind themselves' => ['24.24.24.24'],
-            'IPv4: github.com' =>  ['192.30.255.112'],
+            'IPv4: github.com' => ['192.30.255.112'],
             'IPv6: UCLA' => ['2607:f010:3fe:fff1::ff:fe00:25'],
         ];
     }
index 6d26f71..08f2f75 100644 (file)
@@ -2191,11 +2191,12 @@ function xmldb_main_upgrade($oldversion) {
     }
 
     if ($oldversion < 2018032700.00) {
-
         // Update default search engine to search_simpledb if global search is disabled and there is no solr index defined.
         if (empty($CFG->enableglobalsearch) && empty(get_config('search_solr', 'indexname'))) {
             set_config('searchengine', 'simpledb');
         }
+
+        // Main savepoint reached.
         upgrade_main_savepoint(true, 2018032700.00);
     }
 
diff --git a/message/output/popup/db/install.xml b/message/output/popup/db/install.xml
new file mode 100644 (file)
index 0000000..bb7a992
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<XMLDB PATH="message/output/popup/db" VERSION="20161221" COMMENT="XMLDB file for Moodle message/output/popup"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
+>
+  <TABLES>
+    <TABLE NAME="message_popup" COMMENT="Keep state of notifications for the popup message processor">
+      <FIELDS>
+        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
+        <FIELD NAME="messageid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
+        <FIELD NAME="isread" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
+      </FIELDS>
+      <KEYS>
+        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+      </KEYS>
+      <INDEXES>
+        <INDEX NAME="messageid-isread" UNIQUE="true" FIELDS="messageid, isread"/>
+        <INDEX NAME="isread" UNIQUE="false" FIELDS="isread"/>
+      </INDEXES>
+    </TABLE>
+  </TABLES>
+</XMLDB>
index 26f3b1e..455d89a 100644 (file)
@@ -83,16 +83,5 @@ function xmldb_message_popup_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
-    if ($oldversion < 2018022000) {
-        // Drop table that is no longer needed.
-        $table = new xmldb_table('message_popup');
-        if ($dbman->table_exists($table)) {
-            $dbman->drop_table($table);
-        }
-
-        // Popup savepoint reached.
-        upgrade_plugin_savepoint(true, 2018022000, 'message', 'popup');
-    }
-
     return true;
 }