From 65a1e2630cf95ad9a3bc1760f76d14cb46daf541 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 30 Jul 2021 10:22:17 -0400 Subject: [PATCH] perf: Remove no-longer-used 'backup' columns (#2396) * perf: Remove no-longer-used 'backup' columns These were added as part of the move to the v2 editor over a year ago incase any text was not correctly converted. After a year of use no cases of failed conversion have occurred that required the use of this column * Remove migration, will do in 2-step release --- server/models/Document.js | 6 ------ server/models/Revision.js | 6 ------ 2 files changed, 12 deletions(-) diff --git a/server/models/Document.js b/server/models/Document.js index 78e5cff5..2dffe3ed 100644 --- a/server/models/Document.js +++ b/server/models/Document.js @@ -81,11 +81,6 @@ const Document = sequelize.define( template: DataTypes.BOOLEAN, editorVersion: DataTypes.STRING, text: DataTypes.TEXT, - - // backup contains a record of text at the moment it was converted to v2 - // this is a safety measure during deployment of new editor and will be - // dropped in a future update - backup: DataTypes.TEXT, isWelcome: { type: DataTypes.BOOLEAN, defaultValue: false }, revisionCount: { type: DataTypes.INTEGER, defaultValue: 0 }, archivedAt: DataTypes.DATE, @@ -534,7 +529,6 @@ Document.prototype.migrateVersion = function () { // migrate from document version 1 -> 2 if (this.version === 1) { const nodes = serializer.deserialize(this.text); - this.backup = this.text; this.text = serializer.serialize(nodes, { version: 2 }); this.version = 2; migrated = true; diff --git a/server/models/Revision.js b/server/models/Revision.js index 17281319..6e6f4d95 100644 --- a/server/models/Revision.js +++ b/server/models/Revision.js @@ -14,11 +14,6 @@ const Revision = sequelize.define("revision", { editorVersion: DataTypes.STRING, title: DataTypes.STRING, text: DataTypes.TEXT, - - // backup contains a record of text at the moment it was converted to v2 - // this is a safety measure during deployment of new editor and will be - // dropped in a future update - backup: DataTypes.TEXT, }); Revision.associate = (models) => { @@ -81,7 +76,6 @@ Revision.prototype.migrateVersion = function () { // migrate from document version 1 -> 2 if (this.version === 1) { const nodes = serializer.deserialize(this.text); - this.backup = this.text; this.text = serializer.serialize(nodes, { version: 2 }); this.version = 2; migrated = true;