diff --git a/ghost/core/core/server/data/migrations/versions/5.100/2024-11-05-14-48-08-add-comments-in-reply-to-id.js b/ghost/core/core/server/data/migrations/versions/5.100/2024-11-05-14-48-08-add-comments-in-reply-to-id.js new file mode 100644 index 000000000000..2538ef425735 --- /dev/null +++ b/ghost/core/core/server/data/migrations/versions/5.100/2024-11-05-14-48-08-add-comments-in-reply-to-id.js @@ -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 +}); diff --git a/ghost/core/core/server/data/schema/schema.js b/ghost/core/core/server/data/schema/schema.js index 45e686012a43..8d926ea81de1 100644 --- a/ghost/core/core/server/data/schema/schema.js +++ b/ghost/core/core/server/data/schema/schema.js @@ -958,6 +958,7 @@ module.exports = { post_id: {type: 'string', maxlength: 24, nullable: false, unique: false, references: 'posts.id', cascadeDelete: true}, member_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'members.id', setNullDelete: true}, parent_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'comments.id', cascadeDelete: true}, + in_reply_to_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'comments.id', setNullDelete: true}, status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'published', validations: {isIn: [['published', 'hidden', 'deleted']]}}, html: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true}, edited_at: {type: 'dateTime', nullable: true}, diff --git a/ghost/core/test/unit/server/data/schema/integrity.test.js b/ghost/core/test/unit/server/data/schema/integrity.test.js index 0fca78eb7517..c066a503085e 100644 --- a/ghost/core/test/unit/server/data/schema/integrity.test.js +++ b/ghost/core/test/unit/server/data/schema/integrity.test.js @@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route */ describe('DB version integrity', function () { // Only these variables should need updating - const currentSchemaHash = '1110f25f639c22135b9845c72f0be7ef'; + const currentSchemaHash = 'f12341a0c74998eeb4628322fd0982fb'; const currentFixturesHash = '475f488105c390bb0018db90dce845f1'; const currentSettingsHash = '47a75e8898fab270174a0c905cb3e914'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';