mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-15 12:55:59 +00:00
QFix: migration (#3734)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
71570ec251
commit
a36e734dfc
@ -249,7 +249,7 @@ class TServerStorage implements ServerStorage {
|
|||||||
const oldAttachedTo = (await findAll(ctx, _class, { _id }, { limit: 1 }))[0]
|
const oldAttachedTo = (await findAll(ctx, _class, { _id }, { limit: 1 }))[0]
|
||||||
let oldTx: Tx | null = null
|
let oldTx: Tx | null = null
|
||||||
if (oldAttachedTo !== undefined) {
|
if (oldAttachedTo !== undefined) {
|
||||||
const attr = this.hierarchy.getAttribute(oldAttachedTo._class, colTx.collection)
|
const attr = this.hierarchy.findAttribute(oldAttachedTo._class, colTx.collection)
|
||||||
|
|
||||||
if (attr !== undefined) {
|
if (attr !== undefined) {
|
||||||
oldTx = await this.getCollectionUpdateTx(_id, _class, tx.modifiedBy, colTx.modifiedOn, oldAttachedTo, {
|
oldTx = await this.getCollectionUpdateTx(_id, _class, tx.modifiedBy, colTx.modifiedOn, oldAttachedTo, {
|
||||||
@ -262,7 +262,7 @@ class TServerStorage implements ServerStorage {
|
|||||||
const newAttachedToCollection = operations.collection ?? colTx.collection
|
const newAttachedToCollection = operations.collection ?? colTx.collection
|
||||||
const newAttachedTo = (await findAll(ctx, newAttachedToClass, { _id: operations.attachedTo }, { limit: 1 }))[0]
|
const newAttachedTo = (await findAll(ctx, newAttachedToClass, { _id: operations.attachedTo }, { limit: 1 }))[0]
|
||||||
let newTx: Tx | null = null
|
let newTx: Tx | null = null
|
||||||
const newAttr = this.hierarchy.getAttribute(newAttachedToClass, newAttachedToCollection)
|
const newAttr = this.hierarchy.findAttribute(newAttachedToClass, newAttachedToCollection)
|
||||||
if (newAttachedTo !== undefined && newAttr !== undefined) {
|
if (newAttachedTo !== undefined && newAttr !== undefined) {
|
||||||
newTx = await this.getCollectionUpdateTx(
|
newTx = await this.getCollectionUpdateTx(
|
||||||
newAttachedTo._id,
|
newAttachedTo._id,
|
||||||
|
Loading…
Reference in New Issue
Block a user