Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

profiles MDL-17201 added an index to user_info_data table

  • Loading branch information...
commit 73c07a1f72e890730caaa6816f892042d6c5e607 1 parent 14a4e75
Andrew Davis andyjdavis authored

Showing 3 changed files with 21 additions and 1 deletion. Show diff stats Hide diff stats

  1. +3 0  lib/db/install.xml
  2. +17 0 lib/db/upgrade.php
  3. +1 1  version.php
3  lib/db/install.xml
@@ -933,6 +933,9 @@
933 933 <KEYS>
934 934 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
935 935 </KEYS>
  936 + <INDEXES>
  937 + <INDEX NAME="userfieldidx" UNIQUE="false" FIELDS="userid, fieldid"/>
  938 + </INDEXES>
936 939 </TABLE>
937 940 <TABLE NAME="mnet_enrol_course" COMMENT="Information about courses on remote hosts" PREVIOUS="user_info_data" NEXT="mnet_enrol_assignments">
938 941 <FIELDS>
17 lib/db/upgrade.php
@@ -3351,6 +3351,23 @@ function xmldb_main_upgrade($oldversion=0) {
3351 3351 set_config('filter_mediaplugin_enable_ogg', 1);
3352 3352 upgrade_main_savepoint($result, 2007101590.01);
3353 3353 }
  3354 +
  3355 + if ($result && $oldversion < 2007101591.01) {
  3356 +
  3357 + /// Define index userfieldidx (not unique) to be added to user_info_data
  3358 + $table = new XMLDBTable('user_info_data');
  3359 + $index = new XMLDBIndex('userfieldidx');
  3360 + $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('userid', 'fieldid'));
  3361 +
  3362 + /// Launch add index userfieldidx
  3363 + if (!index_exists($table, $index)) {
  3364 + $result = $result && add_index($table, $index);
  3365 + }
  3366 +
  3367 + /// Main savepoint reached
  3368 + upgrade_main_savepoint($result, 2007101591.01);
  3369 + }
  3370 +
3354 3371 return $result;
3355 3372 }
3356 3373
2  version.php
@@ -6,7 +6,7 @@
6 6 // This is compared against the values stored in the database to determine
7 7 // whether upgrades should be performed (see lib/db/*.php)
8 8
9   - $version = 2007101591.00; // YYYYMMDD = date of the 1.9 branch (don't change)
  9 + $version = 2007101591.01; // YYYYMMDD = date of the 1.9 branch (don't change)
10 10 // X = release number 1.9.[0,1,2,3,4,5...]
11 11 // Y.YY = micro-increments between releases
12 12

0 comments on commit 73c07a1

Please sign in to comment.
Something went wrong with that request. Please try again.