-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
comments.in_reply_to_id
column migration
ref https://linear.app/tryghost/issue/PLG-230 - `comments.in_reply_to_id` will be used to keep a reference to the comment that the new comment was directed at - used only for replies-to-replies, will be `null` for the top-level parent and `null` for any replies directly to that parent - technically allows for infinite nesting within a parent comment thread but we won't be using that ability for now - `comments.parent_id` will be kept as it provides a useful optimisation for loading the top-level comments list - we're not using `comments.parent_id` for this to keep complexity down and avoid the need for recursive lookups
- Loading branch information
1 parent
cd8d581
commit 8b5f278
Showing
3 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.../server/data/migrations/versions/5.100/2024-11-05-14-48-08-add-comments-in-reply-to-id.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const {createAddColumnMigration} = require('../../utils'); | ||
|
||
module.exports = createAddColumnMigration('comments', 'in_reply_to_id', { | ||
type: 'string', | ||
maxlength: 24, | ||
nullable: true, | ||
unique: false, | ||
references: 'comments.id', | ||
setNullDelete: true | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters