Permalink
Browse files

MDL-35073 badges: fix incorrect fk name

Good spotting Damyon!
  • Loading branch information...
danpoltawski committed Apr 5, 2013
1 parent bdc518b commit 2916ca61beff3d3bba9417be9acb932e5ec08ff1
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/db/install.xml
  2. +1 −1 lib/db/upgrade.php
View
@@ -3039,7 +3039,7 @@
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
- <KEY NAME="fk_badgeid" TYPE="foreign" FIELDS="id" REFTABLE="badge" REFFIELDS="id"/>
+ <KEY NAME="fk_badgeid" TYPE="foreign" FIELDS="badgeid" REFTABLE="badge" REFFIELDS="id"/>
<KEY NAME="fk_recipientid" TYPE="foreign" FIELDS="recipientid" REFTABLE="user" REFFIELDS="id"/>
<KEY NAME="fk_issuerid" TYPE="foreign" FIELDS="issuerid" REFTABLE="user" REFFIELDS="id"/>
<KEY NAME="fk_issuerrole" TYPE="foreign" FIELDS="issuerrole" REFTABLE="role" REFFIELDS="id"/>
View
@@ -1928,7 +1928,7 @@ function xmldb_main_upgrade($oldversion) {
// Adding keys to table 'badge_manual_award'.
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
- $table->add_key('fk_badgeid', XMLDB_KEY_FOREIGN, array('id'), 'badge', array('id'));
+ $table->add_key('fk_badgeid', XMLDB_KEY_FOREIGN, array('badgeid'), 'badge', array('id'));
$table->add_key('fk_recipientid', XMLDB_KEY_FOREIGN, array('recipientid'), 'user', array('id'));
$table->add_key('fk_issuerid', XMLDB_KEY_FOREIGN, array('issuerid'), 'user', array('id'));
$table->add_key('fk_issuerrole', XMLDB_KEY_FOREIGN, array('issuerrole'), 'role', array('id'));

0 comments on commit 2916ca6

Please sign in to comment.