diff --git a/db/install.xml b/db/install.xml
index 474abd48..9f7d3be1 100644
--- a/db/install.xml
+++ b/db/install.xml
@@ -52,6 +52,7 @@
+
diff --git a/db/upgrade.php b/db/upgrade.php
index a4a2bc7c..40443cc7 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -213,5 +213,14 @@ function xmldb_customcert_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2022041906, 'customcert'); // Replace with the actual version number.
}
+ if ($oldversion < 2022041908) {
+ $table = new xmldb_table('customcert_issues');
+ $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']);
+
+ $dbman->add_key($table, $key);
+
+ upgrade_mod_savepoint(true, 2022041908, 'customcert');
+ }
+
return true;
}
diff --git a/version.php b/version.php
index 2af604de..d52187f0 100644
--- a/version.php
+++ b/version.php
@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
-$plugin->version = 2022041906; // The current module version (Date: YYYYMMDDXX).
+$plugin->version = 2022041908; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2022041900; // Requires this Moodle version (4.0).
$plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->component = 'mod_customcert';