Added work-around for upgrade 2.1 -> 3.0
authorAlexander Ebert <ebert@woltlab.com>
Wed, 11 Jan 2017 11:26:06 +0000 (12:26 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 11 Jan 2017 11:26:06 +0000 (12:26 +0100)
com.woltlab.wcf/files_pre_update.tar
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0_rc_3.php [deleted file]
wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_appConfig.php [new file with mode: 0644]
wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0_noop.php [new file with mode: 0644]

index 9753f420139317ca34ff45700846b379fbfbd3ca..e2b50d596ec9a4e102d5faa16e07c6187f5843f3 100644 (file)
Binary files a/com.woltlab.wcf/files_pre_update.tar and b/com.woltlab.wcf/files_pre_update.tar differ
index 55bb2150ca540c714f2694efc94bc868357e9621..e2e051e035a7d44a0cc9046f3ca72432265685e1 100644 (file)
                <instruction type="script">acp/update_com.woltlab.wcf_3.0_pre_sql.php</instruction>
                <instruction type="sql">update_part1.sql</instruction>
                
-               <instruction type="file" run="standalone">files.tar</instruction>
+               <instruction type="script" run="standalone" flushCache="false">acp/update_com.woltlab.wcf_3.0_noop.php</instruction>
+               
+               <instruction type="file">files.tar</instruction>
+               <instruction type="script" flushCache="false">acp/update_com.woltlab.wcf_3.0_appConfig.php</instruction>
+               
                <instruction type="script" run="standalone" flushCache="false">acp/update_com.woltlab.wcf_3.0_columnLength.php</instruction>
                <instruction type="sql" run="standalone">update_1.sql</instruction>
                <instruction type="sql" run="standalone">update_2.sql</instruction>
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 (file)
index d84819e..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-use wcf\system\WCF;
-
-/**
- * @author     Alexander Ebert
- * @copyright  2001-2017 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index 0000000..ad3055d
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+use wcf\data\package\Package;
+
+/**
+ * @author     Alexander Ebert
+ * @copyright  2001-2017 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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 (file)
index 0000000..403a41c
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+/* DO NOT REMOVE THIS FILE! -- As strange as it looks, this is a necessary work-around */