Skip to content

Commit

Permalink
Revert "Make index not unique (#537)"
Browse files Browse the repository at this point in the history
This reverts commit ea2b38f.

I decided that since the code is written
with the assumption that there is only one
issue per person that I would revert this.
If the logic changes I will change this to
non-unique.
  • Loading branch information
mdjnelson committed Jan 10, 2024
1 parent 8bc426a commit 60b6b55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<KEY NAME="customcert" TYPE="foreign" FIELDS="customcertid" REFTABLE="customcert" REFFIELDS="id"/>
</KEYS>
<INDEXES>
<INDEX NAME="userid-customcertid" UNIQUE="false" FIELDS="userid, customcertid"/>
<INDEX NAME="userid-customcertid" UNIQUE="true" FIELDS="userid, customcertid"/>
</INDEXES>
</TABLE>
<TABLE NAME="customcert_pages" COMMENT="Stores each page of a custom cert">
Expand Down
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function xmldb_customcert_upgrade($oldversion) {
if ($oldversion < 2023042403) {
// Define index to be added to customcert_issues.
$table = new xmldb_table('customcert_issues');
$index = new xmldb_index('userid-customcertid', XMLDB_INDEX_NOTUNIQUE, ['userid', 'customcertid']);
$index = new xmldb_index('userid-customcertid', XMLDB_INDEX_UNIQUE, ['userid', 'customcertid']);

// Conditionally launch add index.
if (!$dbman->index_exists($table, $index)) {
Expand Down

0 comments on commit 60b6b55

Please sign in to comment.