Browse files

MDL-35073 badges: fix duplicate indexes

  • Loading branch information...
1 parent a8fdb36 commit bdc518b5073baf96bfb026463c597a64581b23a5 @danpoltawski danpoltawski committed Apr 5, 2013
Showing with 1 addition and 20 deletions.
  1. +1 −10 lib/db/install.xml
  2. +0 −10 lib/db/upgrade.php
View
11 lib/db/install.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20130402" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20130405" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
@@ -2977,7 +2977,6 @@
<KEY NAME="fk_badgeid" TYPE="foreign" FIELDS="badgeid" REFTABLE="badge" REFFIELDS="id"/>
</KEYS>
<INDEXES>
- <INDEX NAME="badgeid" UNIQUE="false" FIELDS="badgeid"/>
<INDEX NAME="criteriatype" UNIQUE="false" FIELDS="criteriatype"/>
<INDEX NAME="badgecriteriatype" UNIQUE="true" FIELDS="badgeid, criteriatype"/>
</INDEXES>
@@ -2993,9 +2992,6 @@
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="fk_critid" TYPE="foreign" FIELDS="critid" REFTABLE="badge_criteria" REFFIELDS="id"/>
</KEYS>
- <INDEXES>
- <INDEX NAME="critid" UNIQUE="false" FIELDS="critid"/>
- </INDEXES>
</TABLE>
<TABLE NAME="badge_issued" COMMENT="Defines issued badges">
<FIELDS>
@@ -3014,8 +3010,6 @@
<KEY NAME="fk_userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
</KEYS>
<INDEXES>
- <INDEX NAME="badgeid" UNIQUE="false" FIELDS="badgeid"/>
- <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
<INDEX NAME="badgeuser" UNIQUE="true" FIELDS="badgeid, userid"/>
</INDEXES>
</TABLE>
@@ -3066,9 +3060,6 @@
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="fk_userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
</KEYS>
- <INDEXES>
- <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
- </INDEXES>
</TABLE>
</TABLES>
</XMLDB>
View
10 lib/db/upgrade.php
@@ -1843,7 +1843,6 @@ function xmldb_main_upgrade($oldversion) {
$table->add_key('fk_badgeid', XMLDB_KEY_FOREIGN, array('badgeid'), 'badge', array('id'));
// Adding indexes to table 'badge_criteria'.
- $table->add_index('badgeid', XMLDB_INDEX_NOTUNIQUE, array('badgeid'));
$table->add_index('criteriatype', XMLDB_INDEX_NOTUNIQUE, array('criteriatype'));
$table->add_index('badgecriteriatype', XMLDB_INDEX_UNIQUE, array('badgeid', 'criteriatype'));
@@ -1865,9 +1864,6 @@ function xmldb_main_upgrade($oldversion) {
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
$table->add_key('fk_critid', XMLDB_KEY_FOREIGN, array('critid'), 'badge_criteria', array('id'));
- // Adding indexes to table 'badge_criteria_param'.
- $table->add_index('critid', XMLDB_INDEX_NOTUNIQUE, array('critid'));
-
// Conditionally launch create table for 'badge_criteria_param'.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
@@ -1891,9 +1887,6 @@ function xmldb_main_upgrade($oldversion) {
$table->add_key('fk_badgeid', XMLDB_KEY_FOREIGN, array('badgeid'), 'badge', array('id'));
$table->add_key('fk_userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));
- // Adding indexes to table 'badge_issued'.
- $table->add_index('badgeid', XMLDB_INDEX_NOTUNIQUE, array('badgeid'));
- $table->add_index('userid', XMLDB_INDEX_NOTUNIQUE, array('userid'));
$table->add_index('badgeuser', XMLDB_INDEX_UNIQUE, array('badgeid', 'userid'));
// Conditionally launch create table for 'badge_issued'.
@@ -1962,9 +1955,6 @@ function xmldb_main_upgrade($oldversion) {
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
$table->add_key('fk_userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));
- // Adding indexes to table 'badge_backpack'.
- $table->add_index('userid', XMLDB_INDEX_NOTUNIQUE, array('userid'));
-
// Conditionally launch create table for 'badge_backpack'.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);

0 comments on commit bdc518b

Please sign in to comment.