From 5b1f59c0ce8c1538445adeb383c708fe1d496208 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 22 Aug 2019 11:58:48 +0200 Subject: [PATCH] Remove orphaned calendar data from deleted subscriptions Closes #16833. Ref #13511 Signed-off-by: Thomas Citharel --- apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php index 17643587904fb..424c45096d551 100644 --- a/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php +++ b/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php @@ -55,6 +55,13 @@ public function run(IOutput $output) { $orphanItems = $this->removeOrphanChildren('calendarchanges', 'calendars', 'calendarid'); $output->info(sprintf('%d changes without a calendar have been cleaned up', $orphanItems)); + $orphanItems = $this->removeOrphanChildren('calendarobjects_props', 'calendarsubscriptions', 'objectid'); + $output->info(sprintf('%d properties from cached events without a calendar subscription have been cleaned up', $orphanItems)); + $orphanItems = $this->removeOrphanChildren('calendarobjects', 'calendarsubscriptions', 'calendarid'); + $output->info(sprintf('%d cached events without a calendar subscription have been cleaned up', $orphanItems)); + $orphanItems = $this->removeOrphanChildren('calendarchanges', 'calendarsubscriptions', 'calendarid'); + $output->info(sprintf('%d changes without a calendar subscription have been cleaned up', $orphanItems)); + $orphanItems = $this->removeOrphanChildren('cards', 'addressbooks', 'addressbookid'); $output->info(sprintf('%d contacts without an addressbook have been cleaned up', $orphanItems)); $orphanItems = $this->removeOrphanChildren('cards_properties', 'cards', 'cardid');