Drop obsolete upgrade instructions from 5.4 to 5.5
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 09:45:42 +0000 (11:45 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 09:45:42 +0000 (11:45 +0200)
files/acp/database/update_com.woltlab.wcf.conversation_5.5_step1.php [deleted file]
files/acp/database/update_com.woltlab.wcf.conversation_5.5_step2.php [deleted file]
files/acp/update_com.woltlab.wcf.conversation_5.5_cleanup_orphaned_attachments.php [deleted file]

diff --git a/files/acp/database/update_com.woltlab.wcf.conversation_5.5_step1.php b/files/acp/database/update_com.woltlab.wcf.conversation_5.5_step1.php
deleted file mode 100644 (file)
index 650db8d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-/**
- * @author  Tim Duesterhus
- * @copyright   2001-2020 WoltLab GmbH
- * @license WoltLab License <http://www.woltlab.com/license-agreement.html>
- */
-
-// Reuse the install script to create the indices with the correct names.
-
-return require(__DIR__ . '/install_com.woltlab.wcf.conversation.php');
diff --git a/files/acp/database/update_com.woltlab.wcf.conversation_5.5_step2.php b/files/acp/database/update_com.woltlab.wcf.conversation_5.5_step2.php
deleted file mode 100644 (file)
index 3ecc7ec..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-
-/**
- * @author  Tim Duesterhus
- * @copyright   2001-2021 WoltLab GmbH
- * @license WoltLab License <http://www.woltlab.com/license-agreement.html>
- */
-
-use wcf\system\database\table\index\DatabaseTableIndex;
-use wcf\system\database\table\index\DatabaseTablePrimaryIndex;
-use wcf\system\database\table\PartialDatabaseTable;
-
-// 1) Generate a blueprint to fill in the generated index names.
-
-$blueprint = [
-    PartialDatabaseTable::create('wcf1_conversation')
-        ->indices([
-            // DatabaseTablePrimaryIndex::create()
-            //    ->columns(['conversationID']),
-            DatabaseTableIndex::create()
-                ->columns(['userID', 'isDraft']),
-        ]),
-    PartialDatabaseTable::create('wcf1_conversation_to_user')
-        ->indices([
-            DatabaseTableIndex::create()
-                ->columns(['participantID', 'conversationID'])
-                ->type(DatabaseTableIndex::UNIQUE_TYPE),
-            // DatabaseTableIndex::create()
-            //    ->columns(['participantID', 'hideConversation']),
-        ]),
-    PartialDatabaseTable::create('wcf1_conversation_message')
-        ->indices([
-            // DatabaseTablePrimaryIndex::create()
-            //    ->columns(['messageID']),
-            DatabaseTableIndex::create()
-                ->columns(['conversationID', 'userID']),
-            DatabaseTableIndex::create()
-                ->columns(['ipAddress']),
-        ]),
-    PartialDatabaseTable::create('wcf1_conversation_label')
-        ->indices([
-            // DatabaseTablePrimaryIndex::create()
-            //    ->columns(['labelID']),
-        ]),
-    PartialDatabaseTable::create('wcf1_conversation_label_to_object')
-        ->indices([
-            DatabaseTableIndex::create()
-                ->columns(['labelID', 'conversationID'])
-                ->type(DatabaseTableIndex::UNIQUE_TYPE),
-        ]),
-];
-
-// 2) Use this blueprint to recreate the index objects with ->generatedName() set to false.
-// Simply dropping the indices with ->generatedName() set to true does not work, because it will
-// also remove named indices as the fact that a name was generated does not persist to the database.
-
-$data = [];
-foreach ($blueprint as $blueprintTable) {
-    $data[] = PartialDatabaseTable::create($blueprintTable->getName())
-        ->indices(\array_map(static function ($index) {
-            \assert($index instanceof DatabaseTableIndex);
-
-            return DatabaseTableIndex::create($index->getName())
-                ->columns($index->getColumns())
-                ->type($index->getType())
-                ->drop();
-        }, $blueprintTable->getIndices()));
-}
-
-return $data;
diff --git a/files/acp/update_com.woltlab.wcf.conversation_5.5_cleanup_orphaned_attachments.php b/files/acp/update_com.woltlab.wcf.conversation_5.5_cleanup_orphaned_attachments.php
deleted file mode 100644 (file)
index 7dc5759..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-/**
- * Deletes orphaned attachments.
- *
- * @author  Tim Duesterhus
- * @copyright   2001-2022 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core
- */
-
-use wcf\data\attachment\AttachmentAction;
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\system\package\SplitNodeException;
-use wcf\system\WCF;
-
-$objectType = ObjectTypeCache::getInstance()
-    ->getObjectTypeByName('com.woltlab.wcf.attachment.objectType', 'com.woltlab.wcf.conversation.message');
-
-$sql = "SELECT  attachmentID
-        FROM    wcf1_attachment
-        WHERE   objectTypeID = ?
-            AND objectID NOT IN (
-                SELECT  messageID
-                FROM    wcf1_conversation_message
-            )";
-$statement = WCF::getDB()->prepare($sql, 100);
-$statement->execute([$objectType->objectTypeID]);
-$attachmentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
-
-if (empty($attachmentIDs)) {
-    return;
-}
-
-(new AttachmentAction($attachmentIDs, 'delete'))->executeAction();
-
-// If we reached this location we processed at least one attachment.
-// If this was the final attachment the next iteration will abort this
-// script early, thus not splitting the node.
-throw new SplitNodeException();