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:
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user