From 2157cc74a49bd3f1ec33db2d675edf5fe8782e5a Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Tue, 22 Jun 2021 14:18:28 +1000 Subject: [PATCH 01/13] MDL-49795 logstore_standard: add foreign keys for userids & courseid Fields affected: userid, realuserid, courseid & relateduserid --- admin/tool/log/store/standard/db/install.xml | 6 +++- admin/tool/log/store/standard/db/upgrade.php | 29 +++++++++++++++++++- admin/tool/log/store/standard/version.php | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/admin/tool/log/store/standard/db/install.xml b/admin/tool/log/store/standard/db/install.xml index e3b8c40b7e2..67b9abae7bf 100644 --- a/admin/tool/log/store/standard/db/install.xml +++ b/admin/tool/log/store/standard/db/install.xml @@ -1,5 +1,5 @@ - @@ -31,6 +31,10 @@ + + + + diff --git a/admin/tool/log/store/standard/db/upgrade.php b/admin/tool/log/store/standard/db/upgrade.php index 6496e66b446..4d35052f39c 100644 --- a/admin/tool/log/store/standard/db/upgrade.php +++ b/admin/tool/log/store/standard/db/upgrade.php @@ -25,13 +25,40 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_logstore_standard_upgrade($oldversion) { - global $CFG; + global $CFG, $DB; + + require_once($CFG->libdir.'/db/upgradelib.php'); // Core Upgrade-related functions. + + $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. // Automatically generated Moodle v4.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2022053000) { + // Define index relateduserid (not unique) to be added to logstore_standard_log. + $table = new xmldb_table('logstore_standard_log'); + + // Launch add key userid. + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + $dbman->add_key($table, $key); + + // Launch add key courseid. + $key = new xmldb_key('courseid', XMLDB_KEY_FOREIGN, ['courseid'], 'course', ['id']); + $dbman->add_key($table, $key); + + // Launch add key realuserid. + $key = new xmldb_key('realuserid', XMLDB_KEY_FOREIGN, ['realuserid'], 'user', ['id']); + $dbman->add_key($table, $key); + + // Launch add key relateduserid. + $key = new xmldb_key('relateduserid', XMLDB_KEY_FOREIGN, ['relateduserid'], 'user', ['id']); + $dbman->add_key($table, $key); + + // Standard savepoint reached. + upgrade_plugin_savepoint(true, 2022053000, 'logstore', 'standard'); + } return true; } diff --git a/admin/tool/log/store/standard/version.php b/admin/tool/log/store/standard/version.php index eb1e891e4c3..a4e9d286927 100644 --- a/admin/tool/log/store/standard/version.php +++ b/admin/tool/log/store/standard/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2022053000; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2022041200; // Requires this Moodle version. $plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics). From 08564004ec5ab9b92d05623dbc6b0d169fd8a069 Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Fri, 25 Jun 2021 15:10:20 +1000 Subject: [PATCH 02/13] MDL-49795 tool_monitor: Add foreign keys to tool_monitor_events --- admin/tool/monitor/db/install.xml | 5 ++++- admin/tool/monitor/db/upgrade.php | 30 ++++++++++++++++++++++++++++++ admin/tool/monitor/version.php | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/admin/tool/monitor/db/install.xml b/admin/tool/monitor/db/install.xml index 1774e5895d1..da64419f0f8 100644 --- a/admin/tool/monitor/db/install.xml +++ b/admin/tool/monitor/db/install.xml @@ -1,5 +1,5 @@ - @@ -76,6 +76,9 @@ + + + diff --git a/admin/tool/monitor/db/upgrade.php b/admin/tool/monitor/db/upgrade.php index 248aea174bd..86781854f70 100644 --- a/admin/tool/monitor/db/upgrade.php +++ b/admin/tool/monitor/db/upgrade.php @@ -33,11 +33,41 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_tool_monitor_upgrade($oldversion) { global $CFG, $DB; + require_once($CFG->libdir.'/db/upgradelib.php'); // Core Upgrade-related functions. + + $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. + // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. // Automatically generated Moodle v4.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2022053000) { + + // Define key courseid (foreign) to be added to tool_monitor_events. + $table = new xmldb_table('tool_monitor_events'); + $key = new xmldb_key('courseid', XMLDB_KEY_FOREIGN, ['courseid'], 'course', ['id']); + + // Launch add key courseid. + $dbman->add_key($table, $key); + + // Define key contextid (foreign) to be added to tool_monitor_events. + $table = new xmldb_table('tool_monitor_events'); + $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); + + // Launch add key contextid. + $dbman->add_key($table, $key); + + // Define key contextinstanceid (foreign) to be added to tool_monitor_events. + $table = new xmldb_table('tool_monitor_events'); + $key = new xmldb_key('contextinstanceid', XMLDB_KEY_FOREIGN, ['contextinstanceid'], 'context', ['instanceid']); + + // Launch add key contextinstanceid. + $dbman->add_key($table, $key); + + // Monitor savepoint reached. + upgrade_plugin_savepoint(true, 2022053000, 'tool', 'monitor'); + } return true; } diff --git a/admin/tool/monitor/version.php b/admin/tool/monitor/version.php index 7c0e0c6c33b..3397cbfcda5 100644 --- a/admin/tool/monitor/version.php +++ b/admin/tool/monitor/version.php @@ -26,6 +26,6 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2022041900; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2022053000; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2022041200; // Requires this Moodle version. $plugin->component = 'tool_monitor'; // Full name of the plugin (used for diagnostics). From a35f0b01c0fe7b91ad0283abc796708dd5ef7f28 Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Fri, 25 Jun 2021 15:15:26 +1000 Subject: [PATCH 03/13] MDL-49795 tool_dataprivacy: Add foreign keys to tool_dataprivacy_purpose --- admin/tool/dataprivacy/db/install.xml | 3 ++- admin/tool/dataprivacy/db/upgrade.php | 12 ++++++++++++ admin/tool/dataprivacy/version.php | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/admin/tool/dataprivacy/db/install.xml b/admin/tool/dataprivacy/db/install.xml index f2e2bf0d5e1..1db738eaf03 100644 --- a/admin/tool/dataprivacy/db/install.xml +++ b/admin/tool/dataprivacy/db/install.xml @@ -1,5 +1,5 @@ - @@ -130,6 +130,7 @@ + diff --git a/admin/tool/dataprivacy/db/upgrade.php b/admin/tool/dataprivacy/db/upgrade.php index 3cfa09b9129..e562f68b44a 100644 --- a/admin/tool/dataprivacy/db/upgrade.php +++ b/admin/tool/dataprivacy/db/upgrade.php @@ -71,6 +71,18 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) { // Automatically generated Moodle v4.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2022053000) { + + // Define key usermodified (foreign) to be added to tool_dataprivacy_purposerole. + $table = new xmldb_table('tool_dataprivacy_purposerole'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Dataprivacy savepoint reached. + upgrade_plugin_savepoint(true, 2022053000, 'tool', 'dataprivacy'); + } return true; } diff --git a/admin/tool/dataprivacy/version.php b/admin/tool/dataprivacy/version.php index baca9cd6fc0..6ffcf4375fb 100644 --- a/admin/tool/dataprivacy/version.php +++ b/admin/tool/dataprivacy/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2022041900; +$plugin->version = 2022053000; $plugin->requires = 2022041200; $plugin->component = 'tool_dataprivacy'; From af71e4f412757c37d3de233e33c9feac5da1596f Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Fri, 25 Jun 2021 17:06:38 +1000 Subject: [PATCH 04/13] MDL-49795 core: Add foreign keys to core tables in lib - Includes changes to tables like course, enrol, stage, etc --- lib/db/install.xml | 60 +++++++- lib/db/upgrade.php | 9 ++ lib/db/upgradelib.php | 336 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 404 insertions(+), 1 deletion(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index ab1e31dfc05..a070c9d7ef6 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -108,6 +108,7 @@ + @@ -257,6 +258,7 @@ + @@ -951,6 +953,7 @@ + @@ -975,6 +978,7 @@ + @@ -1126,6 +1130,8 @@ + + @@ -1622,6 +1628,7 @@ + @@ -1639,6 +1646,7 @@ +
@@ -1688,6 +1696,9 @@ + + +
@@ -1813,6 +1824,8 @@ + + @@ -2204,6 +2217,7 @@ +
@@ -2525,6 +2539,7 @@ +
@@ -2637,6 +2652,7 @@ +
@@ -2665,6 +2681,8 @@ + +
@@ -2910,6 +2928,7 @@ + @@ -3026,7 +3045,11 @@ + + + +
@@ -3100,6 +3123,8 @@ + +
@@ -3470,6 +3495,7 @@ + @@ -3540,6 +3566,8 @@ + + @@ -3558,6 +3586,7 @@ +
@@ -3578,6 +3607,9 @@ + + + @@ -3598,6 +3630,7 @@ + @@ -3622,6 +3655,7 @@ + @@ -3644,6 +3678,8 @@ + +
@@ -3660,6 +3696,7 @@ +
@@ -3673,6 +3710,7 @@ + @@ -3690,6 +3728,9 @@ + + +
@@ -3707,6 +3748,7 @@ + @@ -3726,6 +3768,7 @@ + @@ -3746,6 +3789,7 @@ + @@ -3763,6 +3807,7 @@ + @@ -3787,6 +3832,9 @@ + + + @@ -3806,6 +3854,7 @@ + @@ -3822,6 +3871,7 @@ + @@ -3843,6 +3893,7 @@ + @@ -3862,6 +3913,7 @@ +
@@ -3908,6 +3960,7 @@ +
@@ -3924,6 +3977,7 @@ +
@@ -3965,6 +4019,7 @@ + @@ -3988,6 +4043,7 @@ +
@@ -4117,6 +4173,7 @@ +
@@ -4371,6 +4428,7 @@ +
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 2a81dd07fd5..6d3f0da2c05 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2877,6 +2877,15 @@ privatefiles,moodle|/user/files.php'; // Main savepoint reached. upgrade_main_savepoint(true, 2022061500.00); + + } + + if ($oldversion < 2022072900.00) { + // Call the helper function that updates the foreign keys and indexes in MDL-49795. + upgrade_add_foreign_key_and_indexes(); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2022072900.00); } return true; diff --git a/lib/db/upgradelib.php b/lib/db/upgradelib.php index 48fc3ce461e..820752a8485 100644 --- a/lib/db/upgradelib.php +++ b/lib/db/upgradelib.php @@ -1534,3 +1534,339 @@ function upgrade_fix_file_timestamps() { $recordset->close(); } + +/** + * Upgrade helper to add foreign keys and indexes for MDL-49795 + */ +function upgrade_add_foreign_key_and_indexes() { + global $DB; + + $dbman = $DB->get_manager(); + // Define key originalcourseid (foreign) to be added to course. + $table = new xmldb_table('course'); + $key = new xmldb_key('originalcourseid', XMLDB_KEY_FOREIGN, ['originalcourseid'], 'course', ['id']); + // Launch add key originalcourseid. + $dbman->add_key($table, $key); + + // Define key roleid (foreign) to be added to enrol. + $table = new xmldb_table('enrol'); + $key = new xmldb_key('roleid', XMLDB_KEY_FOREIGN, ['roleid'], 'role', ['id']); + // Launch add key roleid. + $dbman->add_key($table, $key); + + // Define key userid (foreign) to be added to scale. + $table = new xmldb_table('scale'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Define key userid (foreign) to be added to scale_history. + $table = new xmldb_table('scale_history'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Define key courseid (foreign) to be added to post. + $table = new xmldb_table('post'); + $key = new xmldb_key('courseid', XMLDB_KEY_FOREIGN, ['courseid'], 'course', ['id']); + // Launch add key courseid. + $dbman->add_key($table, $key); + + // Define key coursemoduleid (foreign) to be added to post. + $table = new xmldb_table('post'); + $key = new xmldb_key('coursemoduleid', XMLDB_KEY_FOREIGN, ['coursemoduleid'], 'course_modules', ['id']); + // Launch add key coursemoduleid. + $dbman->add_key($table, $key); + + // Define key questionid (foreign) to be added to question_statistics. + $table = new xmldb_table('question_statistics'); + $key = new xmldb_key('questionid', XMLDB_KEY_FOREIGN, ['questionid'], 'question', ['id']); + // Launch add key questionid. + $dbman->add_key($table, $key); + + // Define key questionid (foreign) to be added to question_response_analysis. + $table = new xmldb_table('question_response_analysis'); + $key = new xmldb_key('questionid', XMLDB_KEY_FOREIGN, ['questionid'], 'question', ['id']); + // Launch add key questionid. + $dbman->add_key($table, $key); + + // Define index last_log_id (not unique) to be added to mnet_host. + $table = new xmldb_table('mnet_host'); + $index = new xmldb_index('last_log_id', XMLDB_INDEX_NOTUNIQUE, ['last_log_id']); + // Conditionally launch add index last_log_id. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Define key userid (foreign) to be added to mnet_session. + $table = new xmldb_table('mnet_session'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Define key mnethostid (foreign) to be added to mnet_session. + $table = new xmldb_table('mnet_session'); + $key = new xmldb_key('mnethostid', XMLDB_KEY_FOREIGN, ['mnethostid'], 'mnet_host', ['id']); + // Launch add key mnethostid. + $dbman->add_key($table, $key); + + // Define key userid (foreign) to be added to grade_import_values. + $table = new xmldb_table('grade_import_values'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Define key tempdataid (foreign) to be added to portfolio_log. + $table = new xmldb_table('portfolio_log'); + $key = new xmldb_key('tempdataid', XMLDB_KEY_FOREIGN, ['tempdataid'], 'portfolio_tempdata', ['id']); + // Launch add key tempdataid. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to file_conversion. + $table = new xmldb_table('file_conversion'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key userid (foreign) to be added to repository_instances. + $table = new xmldb_table('repository_instances'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Define key contextid (foreign) to be added to repository_instances. + $table = new xmldb_table('repository_instances'); + $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); + // Launch add key contextid. + $dbman->add_key($table, $key); + + // Define key scaleid (foreign) to be added to rating. + $table = new xmldb_table('rating'); + $key = new xmldb_key('scaleid', XMLDB_KEY_FOREIGN, ['scaleid'], 'scale', ['id']); + // Launch add key scaleid. + $dbman->add_key($table, $key); + + // Define key courseid (foreign) to be added to course_published. + $table = new xmldb_table('course_published'); + $key = new xmldb_key('courseid', XMLDB_KEY_FOREIGN, ['courseid'], 'course', ['id']); + // Launch add key courseid. + $dbman->add_key($table, $key); + + // Define index hubcourseid (not unique) to be added to course_published. + $table = new xmldb_table('course_published'); + $index = new xmldb_index('hubcourseid', XMLDB_INDEX_NOTUNIQUE, ['hubcourseid']); + // Conditionally launch add index hubcourseid. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Define key courseid (foreign) to be added to event_subscriptions. + $table = new xmldb_table('event_subscriptions'); + $key = new xmldb_key('courseid', XMLDB_KEY_FOREIGN, ['courseid'], 'course', ['id']); + // Launch add key courseid. + $dbman->add_key($table, $key); + + // Define key userid (foreign) to be added to event_subscriptions. + $table = new xmldb_table('event_subscriptions'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Define key userid (foreign) to be added to task_log. + $table = new xmldb_table('task_log'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Define key scaleid (foreign) to be added to competency. + $table = new xmldb_table('competency'); + $key = new xmldb_key('scaleid', XMLDB_KEY_FOREIGN, ['scaleid'], 'scale', ['id']); + // Launch add key scaleid. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency. + $table = new xmldb_table('competency'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_coursecompsetting. + $table = new xmldb_table('competency_coursecompsetting'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key contextid (foreign) to be added to competency_framework. + $table = new xmldb_table('competency_framework'); + $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); + // Launch add key contextid. + $dbman->add_key($table, $key); + + // Define key scaleid (foreign) to be added to competency_framework. + $table = new xmldb_table('competency_framework'); + $key = new xmldb_key('scaleid', XMLDB_KEY_FOREIGN, ['scaleid'], 'scale', ['id']); + // Launch add key scaleid. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_framework. + $table = new xmldb_table('competency_framework'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_coursecomp. + $table = new xmldb_table('competency_coursecomp'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key actionuserid (foreign) to be added to competency_evidence. + $table = new xmldb_table('competency_evidence'); + $key = new xmldb_key('actionuserid', XMLDB_KEY_FOREIGN, ['actionuserid'], 'user', ['id']); + // Launch add key actionuserid. + $dbman->add_key($table, $key); + + // Define key contextid (foreign) to be added to competency_evidence. + $table = new xmldb_table('competency_evidence'); + $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); + // Launch add key contextid. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_evidence. + $table = new xmldb_table('competency_evidence'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_userevidence. + $table = new xmldb_table('competency_userevidence'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_plan. + $table = new xmldb_table('competency_plan'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_template. + $table = new xmldb_table('competency_template'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key contextid (foreign) to be added to competency_template. + $table = new xmldb_table('competency_template'); + $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); + // Launch add key contextid. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_templatecomp. + $table = new xmldb_table('competency_templatecomp'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_templatecohort. + $table = new xmldb_table('competency_templatecohort'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key relatedcompetencyid (foreign) to be added to competency_relatedcomp. + $table = new xmldb_table('competency_relatedcomp'); + $key = new xmldb_key('relatedcompetencyid', XMLDB_KEY_FOREIGN, ['relatedcompetencyid'], 'competency', ['id']); + // Launch add key relatedcompetencyid. + $dbman->add_key($table, $key); + + // Define key relatedcompetencyid (foreign) to be added to competency_relatedcomp. + $table = new xmldb_table('competency_relatedcomp'); + $key = new xmldb_key('relatedcompetencyid', XMLDB_KEY_FOREIGN, ['relatedcompetencyid'], 'competency', ['id']); + // Launch add key relatedcompetencyid. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_relatedcomp. + $table = new xmldb_table('competency_relatedcomp'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_usercomp. + $table = new xmldb_table('competency_usercomp'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_usercompcourse. + $table = new xmldb_table('competency_usercompcourse'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_usercompplan. + $table = new xmldb_table('competency_usercompplan'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_plancomp. + $table = new xmldb_table('competency_plancomp'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_userevidencecomp. + $table = new xmldb_table('competency_userevidencecomp'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to competency_modulecomp. + $table = new xmldb_table('competency_modulecomp'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to oauth2_endpoint. + $table = new xmldb_table('oauth2_endpoint'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to oauth2_system_account. + $table = new xmldb_table('oauth2_system_account'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to oauth2_user_field_mapping. + $table = new xmldb_table('oauth2_user_field_mapping'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to analytics_models. + $table = new xmldb_table('analytics_models'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to analytics_models_log. + $table = new xmldb_table('analytics_models_log'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key usermodified (foreign) to be added to oauth2_access_token. + $table = new xmldb_table('oauth2_access_token'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Define key contextid (foreign) to be added to payment_accounts. + $table = new xmldb_table('payment_accounts'); + $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); + // Launch add key contextid. + $dbman->add_key($table, $key); +} From c2167257c97094f83c4bec66bd58a68241ca024b Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Mon, 28 Jun 2021 16:47:10 +1000 Subject: [PATCH 05/13] MDL-49795 mod_book: Add foreign key for course --- mod/book/db/install.xml | 3 ++- mod/book/db/upgrade.php | 10 ++++++++++ mod/book/version.php | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mod/book/db/install.xml b/mod/book/db/install.xml index 61c38b4eb6a..b991b1b18be 100644 --- a/mod/book/db/install.xml +++ b/mod/book/db/install.xml @@ -1,5 +1,5 @@ - @@ -20,6 +20,7 @@ +
diff --git a/mod/book/db/upgrade.php b/mod/book/db/upgrade.php index db6abc23599..a4145c7c409 100644 --- a/mod/book/db/upgrade.php +++ b/mod/book/db/upgrade.php @@ -48,6 +48,16 @@ function xmldb_book_upgrade($oldversion) { // Automatically generated Moodle v4.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2022053000) { + // Define key course (foreign) to be added to book. + $table = new xmldb_table('book'); + $key = new xmldb_key('course', XMLDB_KEY_FOREIGN, ['course'], 'course', ['id']); + // Launch add key course. + $dbman->add_key($table, $key); + + // Book savepoint reached. + upgrade_mod_savepoint(true, 2022053000, 'book'); + } return true; } diff --git a/mod/book/version.php b/mod/book/version.php index cf37ab93b75..83d09ef319b 100644 --- a/mod/book/version.php +++ b/mod/book/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die; $plugin->component = 'mod_book'; // Full name of the plugin (used for diagnostics) -$plugin->version = 2022041900; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2022053000; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2022041200; // Requires this Moodle version. $plugin->cron = 0; // Period for cron to check this module (secs) From 5f50d978df023e2159995204de7b5b2581dc317c Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Mon, 28 Jun 2021 16:51:53 +1000 Subject: [PATCH 06/13] MDL-49795 mod_chat: Add course foreign key to chat_users table --- mod/chat/db/install.xml | 3 ++- mod/chat/db/upgrade.php | 16 +++++++++++++++- mod/chat/version.php | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mod/chat/db/install.xml b/mod/chat/db/install.xml index 1da4bee36d5..dfc44d0257a 100644 --- a/mod/chat/db/install.xml +++ b/mod/chat/db/install.xml @@ -1,5 +1,5 @@ - @@ -82,6 +82,7 @@ + diff --git a/mod/chat/db/upgrade.php b/mod/chat/db/upgrade.php index 0a8c96abbef..f9c8c83babb 100644 --- a/mod/chat/db/upgrade.php +++ b/mod/chat/db/upgrade.php @@ -25,13 +25,27 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_chat_upgrade($oldversion) { - global $CFG; + global $CFG, $DB; + + require_once($CFG->libdir.'/db/upgradelib.php'); // Core Upgrade-related functions. + + $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. // Automatically generated Moodle v4.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2022053000) { + // Define key course (foreign) to be added to chat_users. + $table = new xmldb_table('chat_users'); + $key = new xmldb_key('course', XMLDB_KEY_FOREIGN, ['course'], 'course', ['id']); + // Launch add key course. + $dbman->add_key($table, $key); + + // Chat savepoint reached. + upgrade_mod_savepoint(true, 2022053000, 'chat'); + } return true; } diff --git a/mod/chat/version.php b/mod/chat/version.php index 3ed5c49c4fd..711d86d70ce 100644 --- a/mod/chat/version.php +++ b/mod/chat/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022041900; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2022053000; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2022041200; // Requires this Moodle version. $plugin->component = 'mod_chat'; // Full name of the plugin (used for diagnostics). From c67bc6c10a4ec53f22206042fb36882c379fc1d9 Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Mon, 28 Jun 2021 16:57:22 +1000 Subject: [PATCH 07/13] MDL-49795 mod_forum: Add usermodified foreign key to forum_discussions --- mod/forum/db/install.xml | 3 ++- mod/forum/db/upgrade.php | 11 +++++++++++ mod/forum/version.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mod/forum/db/install.xml b/mod/forum/db/install.xml index 0edb6ab22c4..ed437491d83 100644 --- a/mod/forum/db/install.xml +++ b/mod/forum/db/install.xml @@ -1,5 +1,5 @@ - @@ -63,6 +63,7 @@ + diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index 8236d25a597..cf0d1ab03bc 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -162,5 +162,16 @@ function xmldb_forum_upgrade($oldversion) { upgrade_mod_savepoint(true, 2022062700, 'forum'); } + if ($oldversion < 2022072900) { + // Define key usermodified (foreign) to be added to forum_discussions. + $table = new xmldb_table('forum_discussions'); + $key = new xmldb_key('usermodified', XMLDB_KEY_FOREIGN, ['usermodified'], 'user', ['id']); + // Launch add key usermodified. + $dbman->add_key($table, $key); + + // Forum savepoint reached. + upgrade_mod_savepoint(true, 2022072900, 'forum'); + } + return true; } diff --git a/mod/forum/version.php b/mod/forum/version.php index 4c4d8b261af..f8c383b188d 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022062700; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2022072900; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2022041200; // Requires this Moodle version. $plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics) From 1499f83cad8a6bf56ffa0a64ed47792ca7b312fb Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Mon, 28 Jun 2021 16:58:57 +1000 Subject: [PATCH 08/13] MDL-49795 mod_feedback: Add courseid foreign key to feedback_completed --- mod/feedback/db/install.xml | 3 ++- mod/feedback/db/upgrade.php | 15 ++++++++++++++- mod/feedback/version.php | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/mod/feedback/db/install.xml b/mod/feedback/db/install.xml index 19295e44db0..971492e6bf0 100644 --- a/mod/feedback/db/install.xml +++ b/mod/feedback/db/install.xml @@ -1,5 +1,5 @@ - @@ -80,6 +80,7 @@ + diff --git a/mod/feedback/db/upgrade.php b/mod/feedback/db/upgrade.php index 3e198a1c3b2..f20e918d60d 100644 --- a/mod/feedback/db/upgrade.php +++ b/mod/feedback/db/upgrade.php @@ -42,13 +42,26 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_feedback_upgrade($oldversion) { - global $CFG; + global $CFG, $DB; + + $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. // Automatically generated Moodle v4.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2022053000) { + // Define key courseid (foreign) to be added to feedback_completed. + $table = new xmldb_table('feedback_completed'); + $key = new xmldb_key('courseid', XMLDB_KEY_FOREIGN, ['courseid'], 'course', ['id']); + + // Launch add key courseid. + $dbman->add_key($table, $key); + + // Feedback savepoint reached. + upgrade_mod_savepoint(true, 2022053000, 'feedback'); + } return true; } diff --git a/mod/feedback/version.php b/mod/feedback/version.php index 43b064c57da..1992dd65dfe 100644 --- a/mod/feedback/version.php +++ b/mod/feedback/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022041900; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2022053000; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2022041200; // Requires this Moodle version. $plugin->component = 'mod_feedback'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; From 5ab70be18297194615f70fce588f97d029729781 Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Mon, 28 Jun 2021 17:02:28 +1000 Subject: [PATCH 09/13] MDL-49795 mod_data: Add userid foreign key to data_records --- mod/data/db/install.xml | 3 ++- mod/data/db/upgrade.php | 14 +++++++++++++- mod/data/version.php | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mod/data/db/install.xml b/mod/data/db/install.xml index 38f427a1c80..a9c9de292d1 100644 --- a/mod/data/db/install.xml +++ b/mod/data/db/install.xml @@ -1,5 +1,5 @@ - @@ -91,6 +91,7 @@ +
diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index 1fb0b4c4ee3..c7b0f7a6157 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -22,13 +22,25 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_data_upgrade($oldversion) { - global $CFG; + global $DB; + + $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. // Automatically generated Moodle v4.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2022053000) { + // Define key userid (foreign) to be added to data_records. + $table = new xmldb_table('data_records'); + $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); + // Launch add key userid. + $dbman->add_key($table, $key); + + // Data savepoint reached. + upgrade_mod_savepoint(true, 2022053000, 'data'); + } return true; } diff --git a/mod/data/version.php b/mod/data/version.php index 38c62baa5b8..4e74dfd484a 100644 --- a/mod/data/version.php +++ b/mod/data/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022041900; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2022053000; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2022041200; // Requires this Moodle version. $plugin->component = 'mod_data'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; From aeea0b150223b32e2f68addefdb85916ce0fd30d Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Thu, 1 Jul 2021 14:25:03 +1000 Subject: [PATCH 10/13] MDL-49795 auth_oauth2: Add missing metadata providers for oauth2 tables --- auth/oauth2/classes/privacy/provider.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/auth/oauth2/classes/privacy/provider.php b/auth/oauth2/classes/privacy/provider.php index f5130ae4794..c60abc69ab4 100644 --- a/auth/oauth2/classes/privacy/provider.php +++ b/auth/oauth2/classes/privacy/provider.php @@ -64,6 +64,20 @@ class provider implements ]; $collection->add_database_table('auth_oauth2_linked_login', $authfields, 'privacy:metadata:auth_oauth2:tableexplanation'); + + // Regarding this block, we are unable to export or purge this data, as + // it would damage the oauth2 data across the whole site. + foreach ([ + 'oauth2_endpoint', + 'oauth2_user_field_mapping', + 'oauth2_access_token', + 'oauth2_system_account', + ] as $tablename) { + $collection->add_database_table($tablename, [ + 'usermodified' => 'privacy:metadata:auth_oauth2:usermodified', + ], 'privacy:metadata:auth_oauth2:tableexplanation'); + } + $collection->link_subsystem('core_auth', 'privacy:metadata:auth_oauth2:authsubsystem'); return $collection; From 1495c10c26ea0f475a8aad691cee70950e4e50e4 Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Thu, 1 Jul 2021 14:40:45 +1000 Subject: [PATCH 11/13] MDL-49795 analytics: Add missing metadata providers for analytics tables Affected tables: - analytics_models - analytics_models_log --- analytics/classes/privacy/provider.php | 20 ++++++++++++++++++++ lang/en/analytics.php | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/analytics/classes/privacy/provider.php b/analytics/classes/privacy/provider.php index c147bdfd974..68e306db83c 100644 --- a/analytics/classes/privacy/provider.php +++ b/analytics/classes/privacy/provider.php @@ -96,6 +96,26 @@ class provider implements 'privacy:metadata:analytics:predictionactions' ); + // Regarding this block, we are unable to export or purge this data, as + // it would damage the analytics data across the whole site. + $collection->add_database_table( + 'analytics_models', + [ + 'usermodified' => 'privacy:metadata:analytics:analyticsmodels:usermodified', + ], + 'privacy:metadata:analytics:analyticsmodels' + ); + + // Regarding this block, we are unable to export or purge this data, as + // it would damage the analytics log data across the whole site. + $collection->add_database_table( + 'analytics_models_log', + [ + 'usermodified' => 'privacy:metadata:analytics:analyticsmodelslog:usermodified', + ], + 'privacy:metadata:analytics:analyticsmodelslog' + ); + return $collection; } diff --git a/lang/en/analytics.php b/lang/en/analytics.php index f3d19e8c60e..55c29e0d228 100644 --- a/lang/en/analytics.php +++ b/lang/en/analytics.php @@ -144,6 +144,10 @@ $string['privacy:metadata:analytics:predictionactions:predictionid'] = 'The pred $string['privacy:metadata:analytics:predictionactions:userid'] = 'The user that made the action'; $string['privacy:metadata:analytics:predictionactions:actionname'] = 'The action name'; $string['privacy:metadata:analytics:predictionactions:timecreated'] = 'When the prediction action was performed'; +$string['privacy:metadata:analytics:analyticsmodels'] = 'Analytic Models'; +$string['privacy:metadata:analytics:analyticsmodels:usermodified'] = 'The user that modified the model'; +$string['privacy:metadata:analytics:analyticsmodelslog'] = 'The log used for Analytic Models'; +$string['privacy:metadata:analytics:analyticsmodelslog:usermodified'] = 'The user that modified the log'; $string['processingsitecontents'] = 'Processing site contents'; $string['successfullyanalysed'] = 'Successfully analysed'; $string['timesplittingmethod'] = 'Analysis interval'; From c0e329a78128427b61a81a08a60398475077ed65 Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Thu, 1 Jul 2021 14:49:48 +1000 Subject: [PATCH 12/13] MDL-49795 tool_privacy: Add missing metadata providers for purpose table --- admin/tool/dataprivacy/classes/privacy/provider.php | 10 ++++++++++ admin/tool/dataprivacy/lang/en/tool_dataprivacy.php | 2 ++ 2 files changed, 12 insertions(+) diff --git a/admin/tool/dataprivacy/classes/privacy/provider.php b/admin/tool/dataprivacy/classes/privacy/provider.php index d415002fed5..0668704bed5 100644 --- a/admin/tool/dataprivacy/classes/privacy/provider.php +++ b/admin/tool/dataprivacy/classes/privacy/provider.php @@ -79,6 +79,16 @@ class provider implements 'privacy:metadata:request' ); + // Regarding this block, we are unable to export or purge this data, as + // it would damage the privacy data across the whole site. + $collection->add_database_table( + 'tool_dataprivacy_purposerole', + [ + 'usermodified' => 'privacy:metadata:purpose:usermodified', + ], + 'privacy:metadata:purpose' + ); + $collection->add_user_preference(tool_helper::PREF_REQUEST_FILTERS, 'privacy:metadata:preference:tool_dataprivacy_request-filters'); $collection->add_user_preference(tool_helper::PREF_REQUEST_PERPAGE, diff --git a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php index 4a8e3ff279f..04f7659cb75 100644 --- a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php +++ b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php @@ -232,6 +232,8 @@ $string['privacy'] = 'Privacy'; $string['privacyofficeronly'] = 'Only users who are assigned a privacy officer role ({$a}) have access to this content'; $string['privacy:metadata:preference:tool_dataprivacy_request-filters'] = 'The filters currently applied to the data requests page.'; $string['privacy:metadata:preference:tool_dataprivacy_request-perpage'] = 'The number of data requests the user prefers to see on one page'; +$string['privacy:metadata:purpose'] = 'Information from data purposes made for this site.'; +$string['privacy:metadata:purpose:usermodified'] = 'The ID of the user to who modified the purpose'; $string['privacy:metadata:request'] = 'Information from personal data requests (subject access and deletion requests) made for this site.'; $string['privacy:metadata:request:comments'] = 'Any user comments accompanying the request.'; $string['privacy:metadata:request:userid'] = 'The ID of the user to whom the request belongs'; From 027b6f73d6dfbc1976f29f87b106e5b4a0488ded Mon Sep 17 00:00:00 2001 From: Kevin Pham Date: Thu, 1 Jul 2021 13:59:27 +1000 Subject: [PATCH 13/13] MDL-49795 file: Add missing metadata providers for file_conversion --- files/classes/privacy/provider.php | 6 ++++++ lang/en/files.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/files/classes/privacy/provider.php b/files/classes/privacy/provider.php index efae2a97fd7..44c8694da89 100644 --- a/files/classes/privacy/provider.php +++ b/files/classes/privacy/provider.php @@ -73,6 +73,12 @@ class provider implements 'timemodified' => 'privacy:metadata:files:timemodified', ], 'privacy:metadata:files'); + // Regarding this block, we are unable to export or purge this data, as + // it would damage the file conversion data across the whole site. + $collection->add_database_table('file_conversion', [ + 'usermodified' => 'privacy:metadata:file_conversion:usermodified', + ], 'privacy:metadata:file_conversions'); + $collection->add_subsystem_link('core_userkey', [], 'privacy:metadata:core_userkey'); return $collection; diff --git a/lang/en/files.php b/lang/en/files.php index 8702327d026..d73ab1fc83b 100644 --- a/lang/en/files.php +++ b/lang/en/files.php @@ -25,6 +25,8 @@ defined('MOODLE_INTERNAL') || die(); +$string['privacy:metadata:file_conversions'] = 'A record of the file_conversions performed by a user'; +$string['privacy:metadata:file_conversion:usermodified'] = 'The user who started the file conversion.'; $string['privacy:metadata:files'] = 'A record of the files uploaded or shared by users'; $string['privacy:metadata:files:author'] = 'The author of the file\'s content'; $string['privacy:metadata:files:contenthash'] = 'A hash of the file\'s content';