First PR comment.

This commit is contained in:
mike12345567 2023-09-25 16:58:06 +01:00
parent 28189fa5ae
commit 4d1c749444
3 changed files with 6 additions and 8 deletions

View File

@ -72,7 +72,9 @@ export async function updateWithExport(
}
// get a temporary version of the import
// don't need obj store, the existing app already has everything we need
await backups.importApp(devId, tempDb, template, { objStore: false })
await backups.importApp(devId, tempDb, template, {
importObjStoreContents: false,
})
// get the documents to copy
const documents = await getImportableDocuments(tempDb)
// clear out the old documents

View File

@ -8,11 +8,7 @@ import {
TABLE_ROW_PREFIX,
USER_METDATA_PREFIX,
} from "../../../db/utils"
import {
DB_EXPORT_FILE,
GLOBAL_DB_EXPORT_FILE,
STATIC_APP_FILES,
} from "./constants"
import { DB_EXPORT_FILE, STATIC_APP_FILES } from "./constants"
import fs from "fs"
import { join } from "path"
import env from "../../../environment"

View File

@ -152,7 +152,7 @@ export async function importApp(
appId: string,
db: Database,
template: TemplateType,
opts: { objStore: boolean } = { objStore: true }
opts: { importObjStoreContents: boolean } = { importObjStoreContents: true }
) {
let prodAppId = dbCore.getProdAppID(appId)
let dbStream: any
@ -166,7 +166,7 @@ export async function importApp(
}
const contents = fs.readdirSync(tmpPath)
// have to handle object import
if (contents.length && opts.objStore) {
if (contents.length && opts.importObjStoreContents) {
let promises = []
let excludedFiles = [GLOBAL_DB_EXPORT_FILE, DB_EXPORT_FILE]
for (let filename of contents) {