diff --git a/ghost/core/core/server/data/migrations/versions/5.15/2022-09-12-16-10-add-posts-lexical-column.js b/ghost/core/core/server/data/migrations/versions/5.15/2022-09-12-16-10-add-posts-lexical-column.js new file mode 100644 index 0000000000..3d13e7bcd0 --- /dev/null +++ b/ghost/core/core/server/data/migrations/versions/5.15/2022-09-12-16-10-add-posts-lexical-column.js @@ -0,0 +1,8 @@ +const {createAddColumnMigration} = require('../../utils'); + +module.exports = createAddColumnMigration('posts', 'lexical', { + type: 'text', + maxlength: 1000000000, + fieldtype: 'long', + nullable: true +}); diff --git a/ghost/core/core/server/data/schema/schema.js b/ghost/core/core/server/data/schema/schema.js index 8645894a3f..628a54c318 100644 --- a/ghost/core/core/server/data/schema/schema.js +++ b/ghost/core/core/server/data/schema/schema.js @@ -45,6 +45,7 @@ module.exports = { title: {type: 'string', maxlength: 2000, nullable: false, validations: {isLength: {max: 255}}}, slug: {type: 'string', maxlength: 191, nullable: false}, mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true}, + lexical: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true}, html: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true}, comment_id: {type: 'string', maxlength: 50, nullable: true}, plaintext: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true}, diff --git a/ghost/core/core/server/models/post.js b/ghost/core/core/server/models/post.js index 18118599a2..6bc06bc8c2 100644 --- a/ghost/core/core/server/models/post.js +++ b/ghost/core/core/server/models/post.js @@ -974,7 +974,7 @@ Post = ghostBookshelf.Model.extend({ return filter; } }, { - allowedFormats: ['mobiledoc', 'html', 'plaintext'], + allowedFormats: ['mobiledoc', 'lexical', 'html', 'plaintext'], orderDefaultOptions: function orderDefaultOptions() { return { diff --git a/ghost/core/core/server/services/url/config.js b/ghost/core/core/server/services/url/config.js index 3d3eaa2112..642999ac39 100644 --- a/ghost/core/core/server/services/url/config.js +++ b/ghost/core/core/server/services/url/config.js @@ -12,6 +12,7 @@ module.exports = [ exclude: [ 'title', 'mobiledoc', + 'lexical', 'html', 'plaintext', // @TODO: https://github.com/TryGhost/Ghost/issues/10335 @@ -55,6 +56,7 @@ module.exports = [ exclude: [ 'title', 'mobiledoc', + 'lexical', 'html', 'plaintext', // @TODO: https://github.com/TryGhost/Ghost/issues/10335 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 8655f11160..5ef199756c 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 = '823828c5eafb58c0916307d41e834538'; + const currentSchemaHash = '9cc4c1dae2237d960081d77aa4a528cc'; const currentFixturesHash = '8cf221f0ed930ac1fe8030a58e60d64b'; const currentSettingsHash = 'd54210758b7054e2174fd34aa2320ad7'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';