Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-27721 ratings - drop interim 'unknown' defaults

  • Loading branch information...
commit 2b64de2008404c17396267e110227393ebf298f8 1 parent c464a23
@stronk7 stronk7 authored
Showing with 34 additions and 1 deletion.
  1. +33 −0 lib/db/upgrade.php
  2. +1 −1  version.php
View
33 lib/db/upgrade.php
@@ -6481,6 +6481,39 @@ function xmldb_main_upgrade($oldversion) {
}
// Question engine 2 changes (14) end here
+ if ($oldversion < 2011060500) {
+
+ // Define index uniqueuserrating (not unique) to be dropped form rating
+ $table = new xmldb_table('rating');
+ $index = new xmldb_index('uniqueuserrating', XMLDB_INDEX_NOTUNIQUE,
+ array('component', 'ratingarea', 'contextid', 'itemid'));
+
+ // Drop dependent index before changing fields specs
+ if ($dbman->index_exists($table, $index)) {
+ $dbman->drop_index($table, $index);
+ }
+
+ // Changing the default of field component on table rating to drop it
+ $field = new xmldb_field('component', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, 'contextid');
+
+ // Launch change of default for field component
+ $dbman->change_field_default($table, $field);
+
+ // Changing the default of field ratingarea on table rating to drop it
+ $field = new xmldb_field('ratingarea', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, null, 'component');
+
+ // Launch change of default for field ratingarea
+ $dbman->change_field_default($table, $field);
+
+ // Add dependent index back
+ if (!$dbman->index_exists($table, $index)) {
+ $dbman->add_index($table, $index);
+ }
+
+ // Main savepoint reached
+ upgrade_main_savepoint(true, 2011060500);
+ }
+
return true;
}
View
2  version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2011060313.00; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2011060500.00; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
Please sign in to comment.
Something went wrong with that request. Please try again.