Clear wcf1_package_compatibility when upgrading to 5.5
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 6 Jul 2021 12:30:14 +0000 (14:30 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 7 Jul 2021 11:45:30 +0000 (13:45 +0200)
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageCompatibility.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageCompatibility.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_clearPackageCompatibility.php
new file mode 100644 (file)
index 0000000..487cb74
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * Clear the wcf1_package_compatibility table.
+ *
+ * see https://github.com/WoltLab/WCF/pull/4371
+ *
+ * @author Tim Duesterhus
+ * @copyright 2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\WCF;
+
+$sql = "DELETE FROM wcf1_package_compatibility";
+$statement = WCF::getDB()->prepare($sql);
+$statement->execute();
index 08121ddf71ee7cae3e5a75bc329597ab6d598fae..787776953427024e4608cb051bdee41cc1e77aa1 100644 (file)
@@ -551,12 +551,6 @@ class PackageInstallationDispatcher
             $statement = WCF::getDB()->prepareStatement($sql);
             $statement->execute([$this->queue->packageID]);
 
-            // delete old compatibility versions
-            $sql = "DELETE FROM wcf" . WCF_N . "_package_compatibility
-                    WHERE       packageID = ?";
-            $statement = WCF::getDB()->prepareStatement($sql);
-            $statement->execute([$this->queue->packageID]);
-
             // delete old requirements and dependencies
             $sql = "DELETE FROM wcf" . WCF_N . "_package_requirement
                     WHERE       packageID = ?";