From eaf6e3c7e52f4db0e93957fa7fc9e5155de3325a Mon Sep 17 00:00:00 2001 From: Elena Baidakova Date: Fri, 14 Apr 2023 13:18:41 +0400 Subject: [PATCH] Added `lexical` column to `snippets` table (#16632) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs TryGhost/Team#2904 ### 🤖 Generated by Copilot at 04a6b06 This pull request adds a new `lexical` column to the `snippets` table to store lexical information for snippets. It includes a migration script, a schema update, and a schema hash update. --- .../5.44/2023-04-14-04-17-add-snippets-lexical-column.js | 8 ++++++++ ghost/core/core/server/data/schema/schema.js | 1 + ghost/core/test/unit/server/data/schema/integrity.test.js | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ghost/core/core/server/data/migrations/versions/5.44/2023-04-14-04-17-add-snippets-lexical-column.js diff --git a/ghost/core/core/server/data/migrations/versions/5.44/2023-04-14-04-17-add-snippets-lexical-column.js b/ghost/core/core/server/data/migrations/versions/5.44/2023-04-14-04-17-add-snippets-lexical-column.js new file mode 100644 index 0000000000..26152ee9c6 --- /dev/null +++ b/ghost/core/core/server/data/migrations/versions/5.44/2023-04-14-04-17-add-snippets-lexical-column.js @@ -0,0 +1,8 @@ +const {createAddColumnMigration} = require('../../utils'); + +module.exports = createAddColumnMigration('snippets', '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 c754223367..6fefe8ad03 100644 --- a/ghost/core/core/server/data/schema/schema.js +++ b/ghost/core/core/server/data/schema/schema.js @@ -876,6 +876,7 @@ module.exports = { id: {type: 'string', maxlength: 24, nullable: false, primary: true}, name: {type: 'string', maxlength: 191, nullable: false, unique: true}, mobiledoc: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: false}, + lexical: {type: 'text', maxlength: 1000000000, fieldtype: 'long', nullable: true}, created_at: {type: 'dateTime', nullable: false}, created_by: {type: 'string', maxlength: 24, nullable: false}, updated_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 c2de77db7c..c7e5d6bfe1 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 = '395330cb390d669843e4913b63a4cf25'; + const currentSchemaHash = '8ec1f25b5e9e1dde5b1b8ee04dacf4f9'; const currentFixturesHash = '869ceb3302303494c645f4201540ead3'; const currentSettingsHash = 'e2fc04c37fe89e972b063ee8fd1d4bec'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';