From: Michael <heluecht@pirati.ca>
Date: Fri, 14 Aug 2020 19:21:49 +0000 (+0000)
Subject: IIntroduce pre update function for PR 8927
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cfd819087230d39339dffa08e77c77bfe3e1b4a8;p=friendica.git

IIntroduce pre update function for PR 8927
---

diff --git a/update.php b/update.php
index 2d25ac83d2..6152e2b1e0 100644
--- a/update.php
+++ b/update.php
@@ -562,3 +562,12 @@ function update_1357()
 
 	return Update::SUCCESS;
 }
+
+function pre_update_1358()
+{
+	if (!DBA::e("DELETE FROM `contact-relation` WHERE NOT `relation-cid` IN (SELECT `id` FROM `contact`) OR NOT `cid` IN (SELECT `id` FROM `contact`)")) {
+		return Update::FAILED;
+	}
+
+	return Update::SUCCESS;
+}