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
This commit is contained in:
Tom Moor
2021-07-30 10:22:17 -04:00
committed by GitHub
parent 59de4a7db0
commit 65a1e2630c
2 changed files with 0 additions and 12 deletions

View File

@ -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;

View File

@ -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;