mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #11641 from overleaf/bg-improve-migration-script
improve history migration script GitOrigin-RevId: bd1b4263ccb3d10f0c9d741e4f11671cf307cd58
This commit is contained in:
@@ -18,12 +18,12 @@ const DATETIME_WHEN_FULL_PROJECT_HISTORY_ENABLED =
|
||||
: null
|
||||
|
||||
async function countProjects(query = {}) {
|
||||
const count = await db.projects.count(query)
|
||||
const count = await db.projects.countDocuments(query)
|
||||
return count
|
||||
}
|
||||
|
||||
async function countDocHistory(query = {}) {
|
||||
const count = await db.docHistory.count(query)
|
||||
const count = await db.docHistory.countDocuments(query)
|
||||
return count
|
||||
}
|
||||
|
||||
|
||||
@@ -1295,11 +1295,11 @@ async function migrateProjectHistory(projectId, options = {}) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
// set the display to v2 history
|
||||
logger.debug(
|
||||
{ projectId },
|
||||
'Switching on full project history display for project'
|
||||
)
|
||||
// Set the display to v2 history but allow downgrading (second argument allowDowngrade = true)
|
||||
await ProjectHistoryHandler.promises.upgradeHistory(projectId, true)
|
||||
} catch (error) {
|
||||
// delete the history id again if something failed?
|
||||
|
||||
Reference in New Issue
Block a user