From ea2b38fa71e7bfbd952142299f5d9e9d8736cecb Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 8 Jan 2024 16:12:09 +0000 Subject: [PATCH] Make index not unique (#537) The reason for this is because there may be plans to extend this plugin to allow for multiple certificate issues. Also, there was a bug that allowed for duplicate issues which was resolved but those issues could still exist in users' databases. Instead of creating an upgrade path to delete them just leave it for now. --- db/install.xml | 2 +- db/upgrade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/install.xml b/db/install.xml index 17dedd39..474abd48 100644 --- a/db/install.xml +++ b/db/install.xml @@ -55,7 +55,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index d5f052bf..125d808e 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -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_UNIQUE, ['userid', 'customcertid']); + $index = new xmldb_index('userid-customcertid', XMLDB_INDEX_NOTUNIQUE, ['userid', 'customcertid']); // Conditionally launch add index. if (!$dbman->index_exists($table, $index)) {