UBERF-8259: Do not store system model into DB (#6716)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-09-25 09:27:45 +05:00
committed by GitHub
parent 0da0d6e80a
commit 6fd8018baf
13 changed files with 117 additions and 64 deletions
+2 -2
View File
@@ -1503,7 +1503,7 @@ export function devTool (
.option('-w, --workspace <workspace>', 'Selected workspace only', '')
.option('-c, --concurrency <concurrency>', 'Number of documents being processed concurrently', '10')
.action(async (cmd: { workspace: string, concurrency: string }) => {
const { mongodbUri, dbUrl } = prepareTools()
const { mongodbUri, dbUrl, txes } = prepareTools()
await withDatabase(mongodbUri, async (db, client) => {
await withStorage(mongodbUri, async (adapter) => {
const workspaces = await listWorkspacesPure(db)
@@ -1521,7 +1521,7 @@ export function devTool (
workspaceUrl: workspace.workspaceUrl ?? ''
}
const { pipeline } = await getServerPipeline(toolCtx, mongodbUri, dbUrl, wsUrl)
const { pipeline } = await getServerPipeline(toolCtx, txes, mongodbUri, dbUrl, wsUrl)
await migrateMarkup(toolCtx, adapter, wsId, client, pipeline, parseInt(cmd.concurrency))
+2 -2
View File
@@ -15,7 +15,7 @@ import core, {
} from '@hcengineering/core'
import { getMongoClient, getWorkspaceDB } from '@hcengineering/mongo'
import { type Pipeline, type StorageAdapter } from '@hcengineering/server-core'
import { connect, fetchModel } from '@hcengineering/server-tool'
import { connect } from '@hcengineering/server-tool'
import { jsonToText, markupToYDoc } from '@hcengineering/text'
import { type Db, type FindCursor, type MongoClient } from 'mongodb'
@@ -123,7 +123,7 @@ export async function migrateMarkup (
pipeline: Pipeline,
concurrency: number
): Promise<void> {
const { hierarchy } = await fetchModel(ctx, pipeline)
const hierarchy = pipeline.context.hierarchy
const workspaceDb = client.db(workspaceId.name)