Permalink
Browse files

MDL-27248 remove forgotten unique sortorder index from the course table

  • Loading branch information...
1 parent 0795088 commit 188280a76f8c043fd98bf0f4c9704c006a85c4ec @skodak skodak committed Aug 21, 2011
Showing with 23 additions and 1 deletion.
  1. +22 −0 lib/db/upgrade.php
  2. +1 −1 version.php
View
@@ -3292,6 +3292,15 @@ function xmldb_main_upgrade($oldversion=0) {
}
if ($result && $oldversion < 2007101571.01) {
+ // Remove category_sortorder index that was supposed to be removed long time ago
+ $table = new XMLDBTable('course');
+ $index = new XMLDBIndex('category_sortorder');
+ $index->setAttributes(XMLDB_INDEX_UNIQUE, array('category', 'sortorder'));
+
+ if (index_exists($table, $index)) {
+ drop_index($table, $index);
+ }
+
// MDL-21011 bring down course sort orders away from maximum values
$sql = "SELECT id, category, sortorder from {$CFG->prefix}course
ORDER BY sortorder ASC;";
@@ -3368,6 +3377,19 @@ function xmldb_main_upgrade($oldversion=0) {
upgrade_main_savepoint($result, 2007101591.01);
}
+ if ($result && $oldversion < 2007101591.05) {
+ // Remove category_sortorder index that was supposed to be removed long time ago
+ $table = new XMLDBTable('course');
+ $index = new XMLDBIndex('category_sortorder');
+ $index->setAttributes(XMLDB_INDEX_UNIQUE, array('category', 'sortorder'));
+
+ if (index_exists($table, $index)) {
+ drop_index($table, $index);
+ }
+ upgrade_main_savepoint($result, 2007101591.05);
+ }
+
+
return $result;
}
View
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2007101591.04; // YYYYMMDD = date of the 1.9 branch (don't change)
+ $version = 2007101591.05; // YYYYMMDD = date of the 1.9 branch (don't change)
// X = release number 1.9.[0,1,2,3,4,5...]
// Y.YY = micro-increments between releases

0 comments on commit 188280a

Please sign in to comment.