mirror of
https://github.com/moodle/moodle.git
synced 2025-06-04 07:06:45 +02:00
Merge branch 'MDL-49795-add-missing-keys-indexes-to-core-tables' of https://github.com/keevan/moodle
This commit is contained in:
commit
14ff458b3d
@ -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,
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="admin/tool/dataprivacy/db" VERSION="20191217" COMMENT="XMLDB file for Moodle tool/dataprivacy"
|
||||
<XMLDB PATH="admin/tool/dataprivacy/db" VERSION="20220530" COMMENT="XMLDB file for Moodle tool/dataprivacy"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -130,6 +130,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="purposepurposeid" TYPE="foreign" FIELDS="purposeid" REFTABLE="tool_dataprivacy_purpose" REFFIELDS="id"/>
|
||||
<KEY NAME="puproseroleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="purposerole" UNIQUE="true" FIELDS="purposeid, roleid"/>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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';
|
||||
|
@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2022041900;
|
||||
$plugin->version = 2022053000;
|
||||
$plugin->requires = 2022041200;
|
||||
$plugin->component = 'tool_dataprivacy';
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="admin/tool/log/store/standard/db" VERSION="20140415" COMMENT="XMLDB file for Moodle admin/tool/log/store/standard"
|
||||
<XMLDB PATH="admin/tool/log/store/standard/db" VERSION="20220616" COMMENT="XMLDB file for Moodle admin/tool/log/store/standard"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -31,6 +31,10 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
<KEY NAME="realuserid" TYPE="foreign" FIELDS="realuserid" REFTABLE="user" REFFIELDS="id"/>
|
||||
<KEY NAME="relateduserid" TYPE="foreign" FIELDS="relateduserid" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="timecreated" UNIQUE="false" FIELDS="timecreated"/>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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).
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="admin/tool/monitor/db" VERSION="20141103" COMMENT="XMLDB file for Moodle tool/monitor"
|
||||
<XMLDB PATH="admin/tool/monitor/db" VERSION="20220530" COMMENT="XMLDB file for Moodle tool/monitor"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -76,6 +76,9 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
|
||||
<KEY NAME="contextinstanceid" TYPE="foreign" FIELDS="contextinstanceid" REFTABLE="context" REFFIELDS="instanceid"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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).
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="lib/db" VERSION="20220531" COMMENT="XMLDB file for core Moodle tables"
|
||||
<XMLDB PATH="lib/db" VERSION="20220616" COMMENT="XMLDB file for core Moodle tables"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -108,6 +108,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="originalcourseid" TYPE="foreign" FIELDS="originalcourseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="category" UNIQUE="false" FIELDS="category"/>
|
||||
@ -257,6 +258,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
<KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="enrol" UNIQUE="false" FIELDS="enrol"/>
|
||||
@ -951,6 +953,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
|
||||
@ -975,6 +978,7 @@
|
||||
<KEY NAME="oldid" TYPE="foreign" FIELDS="oldid" REFTABLE="scale" REFFIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
<KEY NAME="loggeduser" TYPE="foreign" FIELDS="loggeduser" REFTABLE="user" REFFIELDS="id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
|
||||
@ -1126,6 +1130,8 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
<KEY NAME="coursemoduleid" TYPE="foreign" FIELDS="coursemoduleid" REFTABLE="course_modules" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="id-userid" UNIQUE="true" FIELDS="id, userid"/>
|
||||
@ -1622,6 +1628,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="questionid" TYPE="foreign" FIELDS="questionid" REFTABLE="question" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="question_response_analysis" COMMENT="Analysis of student responses given to questions.">
|
||||
@ -1639,6 +1646,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="questionid" TYPE="foreign" FIELDS="questionid" REFTABLE="question" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="question_response_count" COMMENT="Count for each responses for each try at a question.">
|
||||
@ -1688,6 +1696,9 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_host table"/>
|
||||
<KEY NAME="applicationid" TYPE="foreign" FIELDS="applicationid" REFTABLE="mnet_application" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="last_log_id" UNIQUE="false" FIELDS="last_log_id"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="mnet_host2service" COMMENT="Information about the services for a given host">
|
||||
<FIELDS>
|
||||
@ -1813,6 +1824,8 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_session table"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
<KEY NAME="mnethostid" TYPE="foreign" FIELDS="mnethostid" REFTABLE="mnet_host" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="token" UNIQUE="true" FIELDS="token"/>
|
||||
@ -2204,6 +2217,7 @@
|
||||
<KEY NAME="itemid" TYPE="foreign" FIELDS="itemid" REFTABLE="grade_items" REFFIELDS="id"/>
|
||||
<KEY NAME="newgradeitem" TYPE="foreign" FIELDS="newgradeitem" REFTABLE="grade_import_newitem" REFFIELDS="id"/>
|
||||
<KEY NAME="importer" TYPE="foreign" FIELDS="importer" REFTABLE="user" REFFIELDS="id" COMMENT="user who is importing"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="tag_coll" COMMENT="Defines different set of tags">
|
||||
@ -2525,6 +2539,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="userfk" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" COMMENT="fk to user table"/>
|
||||
<KEY NAME="portfoliofk" TYPE="foreign" FIELDS="portfolio" REFTABLE="portfolio_instance" REFFIELDS="id" COMMENT="fk to portfolio_instance"/>
|
||||
<KEY NAME="tempdataid" TYPE="foreign" FIELDS="tempdataid" REFTABLE="portfolio_tempdata" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="portfolio_tempdata" COMMENT="stores temporary data for portfolio exports. the id of this table is used for the itemid for the temporary files area. cron can clean up stale records (and associated file data) after expirytime.">
|
||||
@ -2637,6 +2652,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="sourcefileid" TYPE="foreign" FIELDS="sourcefileid" REFTABLE="files" REFFIELDS="id"/>
|
||||
<KEY NAME="destfileid" TYPE="foreign" FIELDS="destfileid" REFTABLE="files" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="repository" COMMENT="This table contains one entry for every configured external repository instance.">
|
||||
@ -2665,6 +2681,8 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="repository_instance_config" COMMENT="The config for intances">
|
||||
@ -2910,6 +2928,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" COMMENT="Relates to context.id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" COMMENT="Relates to user.id"/>
|
||||
<KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="uniqueuserrating" UNIQUE="false" FIELDS="component, ratingarea, contextid, itemid" COMMENT="These fields define a unique user rating of an item"/>
|
||||
@ -3026,7 +3045,11 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="hubcourseid" UNIQUE="false" FIELDS="hubcourseid"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="grading_areas" COMMENT="Identifies gradable areas where advanced grading can happen. For each area, the current active plugin can be set.">
|
||||
<FIELDS>
|
||||
@ -3100,6 +3123,8 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="badge" COMMENT="Defines badge">
|
||||
@ -3470,6 +3495,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="classname" UNIQUE="false" FIELDS="classname"/>
|
||||
@ -3540,6 +3566,8 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="idnumberframework" UNIQUE="true" FIELDS="competencyframeworkid, idnumber"/>
|
||||
@ -3558,6 +3586,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="courseidlink" TYPE="foreign-unique" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" COMMENT="Course foreign key."/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="competency_framework" COMMENT="List of competency frameworks.">
|
||||
@ -3578,6 +3607,9 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
|
||||
<KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="idnumber" UNIQUE="true" FIELDS="idnumber"/>
|
||||
@ -3598,6 +3630,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="courseidlink" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" COMMENT="Course foreign key."/>
|
||||
<KEY NAME="competencyid" TYPE="foreign" FIELDS="competencyid" REFTABLE="competency" REFFIELDS="id" COMMENT="Competency foreign key."/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="courseidruleoutcome" UNIQUE="false" FIELDS="courseid, ruleoutcome"/>
|
||||
@ -3622,6 +3655,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="useridstatus" UNIQUE="false" FIELDS="userid, status"/>
|
||||
@ -3644,6 +3678,8 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="competency_templatecomp" COMMENT="Link a competency to a learning plan template.">
|
||||
@ -3660,6 +3696,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="templateidlink" TYPE="foreign" FIELDS="templateid" REFTABLE="competency_template" REFFIELDS="id" COMMENT="Template foreign key."/>
|
||||
<KEY NAME="competencyid" TYPE="foreign" FIELDS="competencyid" REFTABLE="competency" REFFIELDS="id" COMMENT="Competency foreign key."/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="competency_templatecohort" COMMENT="Default comment for the table, please edit me">
|
||||
@ -3673,6 +3710,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="templateid" UNIQUE="false" FIELDS="templateid"/>
|
||||
@ -3690,6 +3728,9 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="competencyid" TYPE="foreign" FIELDS="competencyid" REFTABLE="competency" REFFIELDS="id"/>
|
||||
<KEY NAME="relatedcompetencyid" TYPE="foreign" FIELDS="relatedcompetencyid" REFTABLE="competency" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="competency_usercomp" COMMENT="User competencies">
|
||||
@ -3707,6 +3748,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="useridcompetency" UNIQUE="true" FIELDS="userid, competencyid"/>
|
||||
@ -3726,6 +3768,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="useridcoursecomp" UNIQUE="true" FIELDS="userid, courseid, competencyid"/>
|
||||
@ -3746,6 +3789,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="usercompetencyplan" UNIQUE="true" FIELDS="userid, competencyid, planid"/>
|
||||
@ -3763,6 +3807,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="planidcompetencyid" UNIQUE="true" FIELDS="planid, competencyid"/>
|
||||
@ -3787,6 +3832,9 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
|
||||
<KEY NAME="actionuserid" TYPE="foreign" FIELDS="actionuserid" REFTABLE="user" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="usercompetencyid" UNIQUE="false" FIELDS="usercompetencyid"/>
|
||||
@ -3806,6 +3854,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
|
||||
@ -3822,6 +3871,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="userevidenceid" UNIQUE="false" FIELDS="userevidenceid"/>
|
||||
@ -3843,6 +3893,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="cmidkey" TYPE="foreign" FIELDS="cmid" REFTABLE="course_modules" REFFIELDS="id" COMMENT="Foreign key on course modules table."/>
|
||||
<KEY NAME="competencyidkey" TYPE="foreign" FIELDS="competencyid" REFTABLE="competency" REFFIELDS="id" COMMENT="Foreign key on competency id."/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="cmidruleoutcome" UNIQUE="false" FIELDS="cmid, ruleoutcome" COMMENT="Index on cmid and outcome so we can quickly find what to do when an activity is completed."/>
|
||||
@ -3862,6 +3913,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="issuer_id_key" TYPE="foreign" FIELDS="issuerid" REFTABLE="oauth2_issuer" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="oauth2_issuer" COMMENT="Details for an oauth 2 connect identity issuer.">
|
||||
@ -3908,6 +3960,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="issueridkey" TYPE="foreign-unique" FIELDS="issuerid" REFTABLE="oauth2_issuer" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="oauth2_user_field_mapping" COMMENT="Mapping of oauth user fields to moodle fields.">
|
||||
@ -3924,6 +3977,7 @@
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="issuerkey" TYPE="foreign" FIELDS="issuerid" REFTABLE="oauth2_issuer" REFFIELDS="id"/>
|
||||
<KEY NAME="uniqinternal" TYPE="unique" FIELDS="issuerid, internalfield"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="course_completion_defaults" COMMENT="Default settings for activities completion">
|
||||
@ -3965,6 +4019,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="enabledandtrained" UNIQUE="false" FIELDS="enabled, trained" COMMENT="Index on enabled and train"/>
|
||||
@ -3988,6 +4043,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="modelid" TYPE="foreign" FIELDS="modelid" REFTABLE="analytics_models" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="analytics_predictions" COMMENT="Predictions">
|
||||
@ -4117,6 +4173,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="issueridkey" TYPE="foreign-unique" FIELDS="issuerid" REFTABLE="oauth2_issuer" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="analytics_used_analysables" COMMENT="List of analysables used by each model">
|
||||
@ -4371,6 +4428,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="payment_gateways" COMMENT="Configuration for one gateway for one payment account">
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/book/db" VERSION="20200907" COMMENT="XMLDB file for Moodle mod_book"
|
||||
<XMLDB PATH="mod/book/db" VERSION="20220530" COMMENT="XMLDB file for Moodle mod_book"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -20,6 +20,7 @@
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="course" TYPE="foreign" FIELDS="course" REFTABLE="course" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="book_chapters" COMMENT="Defines book_chapters">
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/chat/db" VERSION="20171114" COMMENT="XMLDB file for Moodle mod/chat"
|
||||
<XMLDB PATH="mod/chat/db" VERSION="20220530" COMMENT="XMLDB file for Moodle mod/chat"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -82,6 +82,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="chatid" TYPE="foreign" FIELDS="chatid" REFTABLE="chat" REFFIELDS="id"/>
|
||||
<KEY NAME="course" TYPE="foreign" FIELDS="course" REFTABLE="course" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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).
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/data/db" VERSION="20160906" COMMENT="XMLDB file for Moodle mod/data"
|
||||
<XMLDB PATH="mod/data/db" VERSION="20220530" COMMENT="XMLDB file for Moodle mod/data"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -91,6 +91,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="dataid" TYPE="foreign" FIELDS="dataid" REFTABLE="data" REFFIELDS="id"/>
|
||||
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="data_content" COMMENT="the content introduced in each record/fields">
|
||||
|
@ -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 < 2022081600) {
|
||||
// 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, 2022081600, 'data');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2022071201; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2022081600; // 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;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/feedback/db" VERSION="20160511" COMMENT="XMLDB file for Moodle mod/feedback"
|
||||
<XMLDB PATH="mod/feedback/db" VERSION="20220530" COMMENT="XMLDB file for Moodle mod/feedback"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -80,6 +80,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_completed"/>
|
||||
<KEY NAME="feedback" TYPE="foreign" FIELDS="feedback" REFTABLE="feedback" REFFIELDS="id"/>
|
||||
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/forum/db" VERSION="20200508" COMMENT="XMLDB file for Moodle mod/forum"
|
||||
<XMLDB PATH="mod/forum/db" VERSION="20220729" COMMENT="XMLDB file for Moodle mod/forum"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -63,6 +63,7 @@
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
<KEY NAME="forum" TYPE="foreign" FIELDS="forum" REFTABLE="forum" REFFIELDS="id"/>
|
||||
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user