Skip to content

Commit

Permalink
QFix: migration (#3734)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo authored Sep 22, 2023
1 parent 71570ec commit a36e734
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/core/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class TServerStorage implements ServerStorage {
const oldAttachedTo = (await findAll(ctx, _class, { _id }, { limit: 1 }))[0]
let oldTx: Tx | null = null
if (oldAttachedTo !== undefined) {
const attr = this.hierarchy.getAttribute(oldAttachedTo._class, colTx.collection)
const attr = this.hierarchy.findAttribute(oldAttachedTo._class, colTx.collection)

if (attr !== undefined) {
oldTx = await this.getCollectionUpdateTx(_id, _class, tx.modifiedBy, colTx.modifiedOn, oldAttachedTo, {
Expand All @@ -262,7 +262,7 @@ class TServerStorage implements ServerStorage {
const newAttachedToCollection = operations.collection ?? colTx.collection
const newAttachedTo = (await findAll(ctx, newAttachedToClass, { _id: operations.attachedTo }, { limit: 1 }))[0]
let newTx: Tx | null = null
const newAttr = this.hierarchy.getAttribute(newAttachedToClass, newAttachedToCollection)
const newAttr = this.hierarchy.findAttribute(newAttachedToClass, newAttachedToCollection)
if (newAttachedTo !== undefined && newAttr !== undefined) {
newTx = await this.getCollectionUpdateTx(
newAttachedTo._id,
Expand Down

0 comments on commit a36e734

Please sign in to comment.