From: Joshua Rüsweg Date: Mon, 16 Dec 2019 17:18:10 +0000 (+0100) Subject: Add update script to delete all likeable recent activities X-Git-Tag: 5.2.0_RC_2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=50d0700acae2ef3df155351aad914bd052c32ce3;p=GitHub%2FWoltLab%2FWCF.git Add update script to delete all likeable recent activities --- diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index c2b2e3b9c5..be91906a81 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -66,6 +66,9 @@ acp/update_com.woltlab.wcf_5.2_reactionUpdate.php + + acp/update_com.woltlab.wcf_5.2_deleteRecentActivity.php + update_5.2.sql @@ -100,6 +103,7 @@ defaultStyle.tar + acptemplates_update.tar files_update.tar diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_deleteRecentActivity.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_deleteRecentActivity.php new file mode 100644 index 0000000000..5e3df84679 --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.2_deleteRecentActivity.php @@ -0,0 +1,24 @@ + + * @package WoltLabSuite\Core + */ + +$definitionList = new \wcf\data\object\type\definition\ObjectTypeDefinitionList(); +$definitionList->getConditionBuilder()->add('definitionName = ?', ['com.woltlab.wcf.user.recentActivityEvent']); +$definitionList->readObjects(); +$definition = $definitionList->current(); + +$recentActivityList = new \wcf\data\user\activity\event\UserActivityEventList(); +$recentActivityList->getConditionBuilder()->add("objectTypeID IN (SELECT objectTypeID FROM wcf". WCF_N ."_object_type WHERE objectType LIKE '%likeable%' AND definitionID = ?)", [$definition->definitionID]); +$recentActivityList->readObjectIDs(); + +if (count($recentActivityList->getObjectIDs())) { + \wcf\data\user\activity\event\UserActivityEventEditor::deleteAll($recentActivityList->getObjectIDs()); +}