From a119c030fdfe242aa1d3b01b59ffc49fbc8845a8 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Thu, 7 Jan 2021 18:24:26 +0000
Subject: [PATCH] Add some more tables to remove orphans

---
 update.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/update.php b/update.php
index ffcfa6a90f..b5d1784894 100644
--- a/update.php
+++ b/update.php
@@ -835,6 +835,14 @@ function pre_update_1377()
 		return Update::FAILED;
 	}
 
+	if (DBStructure::existsTable('item-activity') && !DBA::e("DELETE FROM `item-activity` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`)")) {
+		return Update::FAILED;
+	}
+
+	if (DBStructure::existsTable('item-content') && !DBA::e("DELETE FROM `item-content` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`)")) {
+		return Update::FAILED;
+	}
+
 	if (!DBA::e("DELETE FROM `notify` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`)")) {
 		return Update::FAILED;
 	}
-- 
2.39.5