mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-23 14:00:08 +02:00

fix history metadata in projects collection GitOrigin-RevId: 18c821ef5966a8470b24dfa60313b09bdda9707d
30 lines
626 B
JavaScript
30 lines
626 B
JavaScript
/* eslint-disable no-unused-vars */
|
|
|
|
import { batchedUpdate } from '@overleaf/mongo-utils/batchedUpdate.js'
|
|
|
|
const tags = ['saas']
|
|
|
|
const migrate = async client => {
|
|
const { db } = client
|
|
|
|
await batchedUpdate(
|
|
db.projects,
|
|
{ 'overleaf.history.currentEndVersion': { $exists: true } },
|
|
{
|
|
$unset: {
|
|
'overleaf.history.currentEndVersion': true,
|
|
'overleaf.history.currentEndTimestamp': true,
|
|
'overleaf.history.updatedAt': true,
|
|
'overleaf.backup.pendingChangeAt': true,
|
|
},
|
|
}
|
|
)
|
|
}
|
|
|
|
const rollback = async client => {}
|
|
|
|
export default {
|
|
tags,
|
|
migrate,
|
|
rollback,
|
|
}
|