mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-65436 message: fix error while upgrading legacy self-conversations
Delete self-messages from the legacy message_read table once they are migrated.
This commit is contained in:
parent
14cdf51189
commit
50255ba981
@ -3128,12 +3128,13 @@ function xmldb_main_upgrade($oldversion) {
|
||||
$mua->timecreated = $message->timeread;
|
||||
|
||||
$DB->insert_record('message_user_actions', $mua);
|
||||
|
||||
// The self-conversation message has been migrated. Delete the record from the legacy table as soon as possible
|
||||
// to avoid migrate it twice.
|
||||
$DB->delete_records('message_read', ['id' => $message->id]);
|
||||
}
|
||||
$legacyselfmessagesrs->close();
|
||||
|
||||
// We can now delete the records from legacy table because the self-conversations have been migrated from the legacy tables.
|
||||
$DB->delete_records_select('message_read', $select);
|
||||
|
||||
// STEP 3. For existing users without self-conversations, create and star it.
|
||||
|
||||
// Get all the users without a self-conversation.
|
||||
|
Loading…
x
Reference in New Issue
Block a user