Skip to content

Commit

Permalink
profiles MDL-17201 added an index to user_info_data table
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjdavis committed Jan 25, 2011
1 parent 14a4e75 commit 73c07a1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,9 @@
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
<INDEXES>
<INDEX NAME="userfieldidx" UNIQUE="false" FIELDS="userid, fieldid"/>
</INDEXES>
</TABLE>
<TABLE NAME="mnet_enrol_course" COMMENT="Information about courses on remote hosts" PREVIOUS="user_info_data" NEXT="mnet_enrol_assignments">
<FIELDS>
Expand Down
17 changes: 17 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3351,6 +3351,23 @@ function xmldb_main_upgrade($oldversion=0) {
set_config('filter_mediaplugin_enable_ogg', 1);
upgrade_main_savepoint($result, 2007101590.01);
}

if ($result && $oldversion < 2007101591.01) {

/// Define index userfieldidx (not unique) to be added to user_info_data
$table = new XMLDBTable('user_info_data');
$index = new XMLDBIndex('userfieldidx');
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('userid', 'fieldid'));

/// Launch add index userfieldidx
if (!index_exists($table, $index)) {
$result = $result && add_index($table, $index);
}

/// Main savepoint reached
upgrade_main_savepoint($result, 2007101591.01);
}

return $result;
}

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.00; // YYYYMMDD = date of the 1.9 branch (don't change)
$version = 2007101591.01; // 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

Expand Down

0 comments on commit 73c07a1

Please sign in to comment.