perf: Improve collab persistence performance (#4544)
* stash * Remove query of state in documentCollaborativeUpdater
This commit is contained in:
@@ -3,6 +3,7 @@ import { compact, uniq } from "lodash";
|
||||
import randomstring from "randomstring";
|
||||
import type { SaveOptions } from "sequelize";
|
||||
import {
|
||||
Sequelize,
|
||||
Transaction,
|
||||
Op,
|
||||
FindOptions,
|
||||
@@ -116,6 +117,17 @@ export const DOCUMENT_VERSION = 2;
|
||||
},
|
||||
],
|
||||
},
|
||||
withStateIsEmpty: {
|
||||
attributes: {
|
||||
exclude: ["state"],
|
||||
include: [
|
||||
[
|
||||
Sequelize.literal(`CASE WHEN state IS NULL THEN true ELSE false END`),
|
||||
"stateIsEmpty",
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
withState: {
|
||||
attributes: {
|
||||
// resets to include the state column
|
||||
|
||||
Reference in New Issue
Block a user