Merge branch 'MDL-34933_23_STABLE' of https://github.com/mchurchward/moodle into...
authorDamyon Wiese <damyon@moodle.com>
Tue, 23 Apr 2013 04:02:30 +0000 (12:02 +0800)
committerDamyon Wiese <damyon@moodle.com>
Tue, 23 Apr 2013 04:02:30 +0000 (12:02 +0800)
Conflicts:
lib/db/upgrade.php
version.php

1  2 
lib/db/upgrade.php
version.php

@@@ -1143,14 -1143,18 +1143,28 @@@ function xmldb_main_upgrade($oldversion
      }
  
      if ($oldversion < 2012062506.06) {
 -        
 +        // MDL-29877 Some bad restores created grade items with no category information.
 +        $sql = "UPDATE {grade_items}
 +                   SET categoryid = courseid
 +                 WHERE itemtype <> 'course' and itemtype <> 'category'
 +                       AND categoryid IS NULL";
 +        $DB->execute($sql);
 +        upgrade_main_savepoint(true, 2012062506.06);
 +    }
 +
++    if ($oldversion < 2012062506.08) {
+         // Adding index to unreadmessageid field of message_working table (MDL-34933)
+         $table = new xmldb_table('message_working');
+         $index = new xmldb_index('unreadmessageid_idx', XMLDB_INDEX_NOTUNIQUE, array('unreadmessageid'));
+         // Conditionally launch add index unreadmessageid
+         if (!$dbman->index_exists($table, $index)) {
+             $dbman->add_index($table, $index);
+         }
 -        upgrade_main_savepoint(true, 2012062506.06);
++
+         // Main savepoint reached.
++        upgrade_main_savepoint(true, 2012062506.08);
+     }
      return true;
  }
diff --cc version.php
@@@ -30,7 -30,7 +30,7 @@@
  defined('MOODLE_INTERNAL') || die();
  
  
- $version  = 2012062506.07;              // YYYYMMDD      = weekly release date of this DEV branch
 -$version  = 2012062506.06;              // YYYYMMDD      = weekly release date of this DEV branch
++$version  = 2012062506.08;              // YYYYMMDD      = weekly release date of this DEV branch
                                          //         RR    = release increments - 00 in DEV branches
                                          //           .XX = incremental changes