From ce55a5294dcce2fcc562ebf75eef1fecf66f0a8b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 11 Jan 2017 12:26:06 +0100 Subject: [PATCH] Added work-around for upgrade 2.1 -> 3.0 --- com.woltlab.wcf/files_pre_update.tar | Bin 3584 -> 4608 bytes com.woltlab.wcf/package.xml | 6 +- .../acp/update_com.woltlab.wcf_3.0.0_rc_3.php | 67 ------------------ .../update_com.woltlab.wcf_3.0_appConfig.php | 10 +++ .../acp/update_com.woltlab.wcf_3.0_noop.php | 2 + 5 files changed, 17 insertions(+), 68 deletions(-) delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php create mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_appConfig.php create mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_noop.php diff --git a/com.woltlab.wcf/files_pre_update.tar b/com.woltlab.wcf/files_pre_update.tar index 9753f420139317ca34ff45700846b379fbfbd3ca..e2b50d596ec9a4e102d5faa16e07c6187f5843f3 100644 GIT binary patch delta 159 zcmZpWX;4|fGl@x_BQHO{K(8R9V4|SyKUM{6iFiTz&n+Topn*JcAY7Jbhdh6?AnK9E%l-ONtWn z(o+=@ixo0U6ms(Ovx{{UN-{Em++u}9g}l_{)Z*gAqDqDG{Gx2##G?Gtyc7j3{mqSB J^~@6$6ao7XEdKxi delta 10 RcmZorX^>gKv$%ne2>=r~10VnZ diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 55bb2150ca..e2e051e035 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -48,7 +48,11 @@ acp/update_com.woltlab.wcf_3.0_pre_sql.php update_part1.sql - files.tar + acp/update_com.woltlab.wcf_3.0_noop.php + + files.tar + acp/update_com.woltlab.wcf_3.0_appConfig.php + acp/update_com.woltlab.wcf_3.0_columnLength.php update_1.sql update_2.sql diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php deleted file mode 100644 index d84819e107..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @package WoltLabSuite\Core - */ -$columns = WCF::getDB()->getEditor()->getColumns("wcf".WCF_N."_application"); -$hasLandingPageID = false; -foreach ($columns as $column) { - if ($column['name'] == 'landingPageID') { - $hasLandingPageID = true; - break; - } -} - -if (!$hasLandingPageID) { - $statement = WCF::getDB()->prepareStatement("ALTER TABLE wcf".WCF_N."_application ADD COLUMN landingPageID INT(10) NULL"); - $statement->execute(); - - $statement = WCF::getDB()->prepareStatement("ALTER TABLE wcf".WCF_N."_application ADD CONSTRAINT `8a7fc72db2348bc5695394ffd616cbf5_fk` FOREIGN KEY (landingPageID) REFERENCES wcf".WCF_N."_page (pageID) ON DELETE SET NULL;"); - $statement->execute(); - - $statement = WCF::getDB()->prepareStatement("UPDATE wcf".WCF_N."_application SET landingPageID = (SELECT pageID FROM wcf".WCF_N."_page WHERE isLandingPage = 1 LIMIT 1) WHERE packageID = 1;"); - $statement->execute(); -} - - -// remove duplicates in page_content -$sql = "DELETE FROM wcf".WCF_N."_page_content - WHERE pageID = ? - AND languageID IS NULL - ORDER BY pageContentID DESC - LIMIT ?"; -$deleteStatement = WCF::getDB()->prepareStatement($sql); - -$sql = "SELECT COUNT(*) AS count, pageID - FROM wcf".WCF_N."_page_content - WHERE languageID IS NULL - GROUP BY pageID - HAVING COUNT(*) > 1"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(); -while ($row = $statement->fetchArray()) { - $deleteStatement->execute([$row['pageID'], $row['count'] - 1]); -} - -// remove duplicates in box_content -$sql = "DELETE FROM wcf".WCF_N."_box_content - WHERE boxID = ? - AND languageID IS NULL - ORDER BY boxContentID DESC - LIMIT ?"; -$deleteStatement = WCF::getDB()->prepareStatement($sql); - -$sql = "SELECT COUNT(*) AS count, boxID - FROM wcf".WCF_N."_box_content - WHERE languageID IS NULL - GROUP BY boxID - HAVING COUNT(*) > 1"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(); -while ($row = $statement->fetchArray()) { - $deleteStatement->execute([$row['boxID'], $row['count'] - 1]); -} diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_appConfig.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_appConfig.php new file mode 100644 index 0000000000..ad3055d9cf --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_appConfig.php @@ -0,0 +1,10 @@ + + * @package WoltLabSuite\Core + */ +Package::writeConfigFile(1); diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_noop.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_noop.php new file mode 100644 index 0000000000..403a41ceb7 --- /dev/null +++ b/wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_noop.php @@ -0,0 +1,2 @@ +