MDL-67312 calendar: upgrade step to delete orphaned events

This commit is contained in:
Simey Lameze
2020-01-20 08:50:51 +08:00
parent abaf1375c1
commit 7434f3abf3
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -3798,5 +3798,15 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2019111800.04);
}
if ($oldversion < 2019111801.02) {
// Delete all orphaned subscription events.
$select = "subscriptionid IS NOT NULL
AND subscriptionid NOT IN (SELECT id from {event_subscriptions})";
$DB->delete_records_select('event', $select);
upgrade_main_savepoint(true, 2019111801.02);
}
return true;
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2019111801.01; // 20191118 = branching date YYYYMMDD - do not modify!
$version = 2019111801.02; // 20191118 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '3.8.1+ (Build: 20200117)'; // Human-friendly version name