Permalink
Browse files

profiles MDL-17201 added an index on the table user_info_data

  • Loading branch information...
1 parent 17e0390 commit 0d92d04f2ec12943ddd5fc5f57e742efa242aa8d @andyjdavis andyjdavis committed Jan 25, 2011
Showing with 17 additions and 2 deletions.
  1. +4 −1 lib/db/install.xml
  2. +12 −0 lib/db/upgrade.php
  3. +1 −1 version.php
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20110114" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20110125" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
@@ -1246,6 +1246,9 @@
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
+ <INDEXES>
+ <INDEX NAME="userfieldidx" UNIQUE="false" FIELDS="userid, fieldid"/>
+ </INDEXES>
</TABLE>
<TABLE NAME="question_categories" COMMENT="Categories are for grouping questions" PREVIOUS="user_info_data" NEXT="question">
<FIELDS>
View
@@ -5956,6 +5956,18 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2011011415);
}
+ if ($oldversion < 2011012500) {
+ //add the index userfieldidx (not unique) to user_info_data
+ $table = new xmldb_table('user_info_data');
+ $index = new xmldb_index('userfieldidx', XMLDB_INDEX_NOTUNIQUE, array('userid', 'fieldid'));
+
+ if (!$dbman->index_exists($table, $index)) {
+ $dbman->add_index($table, $index);
+ }
+
+ upgrade_main_savepoint(true, 2011012500);
+ }
+
return true;
}
View
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2011011900; // YYYYMMDD = date of the last version bump
+$version = 2011012500; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0.1+ (Build: 20110119)'; // Human-friendly version name

0 comments on commit 0d92d04

Please sign in to comment.