Issue 9746: Delete uri-id orphans

This commit is contained in:
Michael 2021-01-07 17:34:23 +00:00
parent 2ae8e5d34e
commit 2f52afeeac

View File

@ -831,6 +831,10 @@ function pre_update_1377()
return Update::FAILED; return Update::FAILED;
} }
if (!DBA::e("DELETE FROM `diaspora-interaction` 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`)")) { if (!DBA::e("DELETE FROM `notify` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`)")) {
return Update::FAILED; return Update::FAILED;
} }
@ -838,7 +842,6 @@ function pre_update_1377()
if (!DBA::e("UPDATE `notify` SET `parent-uri-id` = NULL WHERE `parent-uri-id` = 0")) { if (!DBA::e("UPDATE `notify` SET `parent-uri-id` = NULL WHERE `parent-uri-id` = 0")) {
return Update::FAILED; return Update::FAILED;
} }
if (!DBA::e("DELETE FROM `notify` WHERE `parent-uri-id` NOT IN (SELECT `id` FROM `item-uri`)")) { if (!DBA::e("DELETE FROM `notify` WHERE `parent-uri-id` NOT IN (SELECT `id` FROM `item-uri`)")) {
return Update::FAILED; return Update::FAILED;
} }