From 6048b32a65420c0997862357ade3245b115d6063 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 9 Jun 2021 09:19:02 +0200 Subject: [PATCH] Add `hasEmbeddedObjects` for comments and comment responses --- .../database/update_com.woltlab.wcf_5.5.php | 24 +++++++++++++++++++ .../files/lib/data/comment/Comment.class.php | 1 + .../response/CommentResponse.class.php | 1 + wcfsetup/setup/db/install.sql | 2 ++ 4 files changed, 28 insertions(+) create mode 100644 wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php diff --git a/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php new file mode 100644 index 0000000000..588b336e5b --- /dev/null +++ b/wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.5.php @@ -0,0 +1,24 @@ + + * @package WoltLabSuite\Core + */ + +use wcf\system\database\table\column\DefaultFalseBooleanDatabaseTableColumn; +use wcf\system\database\table\PartialDatabaseTable; + +return [ + PartialDatabaseTable::create('wcf1_comment') + ->columns([ + DefaultFalseBooleanDatabaseTableColumn::create('hasEmbeddedObjects'), + ]), + PartialDatabaseTable::create('wcf1_comment_response') + ->columns([ + DefaultFalseBooleanDatabaseTableColumn::create('hasEmbeddedObjects'), + ]), +]; diff --git a/wcfsetup/install/files/lib/data/comment/Comment.class.php b/wcfsetup/install/files/lib/data/comment/Comment.class.php index 3590e4dcc0..6bcdb877ee 100644 --- a/wcfsetup/install/files/lib/data/comment/Comment.class.php +++ b/wcfsetup/install/files/lib/data/comment/Comment.class.php @@ -31,6 +31,7 @@ use wcf\util\StringUtil; * @property-read string $unfilteredResponseIDs serialized array with the ids of the five latest comment responses, including disabled ones * @property-read int $enableHtml is 1 if HTML will rendered in the comment, otherwise 0 * @property-read int $isDisabled is 1 if the comment is disabled, otherwise 0 + * @property-read int $hasEmbeddedObjects is `1` if there are embedded objects in the comment, otherwise `0` */ class Comment extends DatabaseObject implements IMessage { diff --git a/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php b/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php index 7aef5818d1..50619b581b 100644 --- a/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php @@ -27,6 +27,7 @@ use wcf\util\StringUtil; * @property-read string $message comment response message * @property-read int $enableHtml is 1 if HTML will rendered in the comment response, otherwise 0 * @property-read int $isDisabled is 1 if the comment response is disabled, otherwise 0 + * @property-read int $hasEmbeddedObjects is `1` if there are embedded objects in the comment response, otherwise `0` */ class CommentResponse extends DatabaseObject implements IMessage { diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 34dadc0904..ecddce494b 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -410,6 +410,7 @@ CREATE TABLE wcf1_comment ( unfilteredResponseIDs VARCHAR(255) NOT NULL DEFAULT '', enableHtml TINYINT(1) NOT NULL DEFAULT 0, isDisabled TINYINT(1) NOT NULL DEFAULT 0, + hasEmbeddedObjects TINYINT(1) NOT NULL DEFAULT 0, KEY (objectTypeID, objectID, isDisabled, time), KEY lastCommentTime (userID, time) @@ -425,6 +426,7 @@ CREATE TABLE wcf1_comment_response ( message MEDIUMTEXT NOT NULL, enableHtml TINYINT(1) NOT NULL DEFAULT 0, isDisabled TINYINT(1) NOT NULL DEFAULT 0, + hasEmbeddedObjects TINYINT(1) NOT NULL DEFAULT 0, KEY (commentID, isDisabled, time), KEY lastResponseTime (userID, time) -- 2.20.1