overleaf/services/web/migrations/20240618125145_cleanup_user_features_templates.mjs
Liangjun Song 26f3f3e2e2 Merge pull request #21097 from overleaf/ls-scripts-to-esm-1
Migrate scripts folder to esm 1/x

GitOrigin-RevId: 4a4bc9a161f144fdb40ce3f2a0a9313b36c6df81
2024-10-21 08:04:42 +00:00

20 lines
420 B
JavaScript

import BatchedUpdateScript from '../scripts/helpers/batchedUpdate.mjs'
const { batchedUpdate } = BatchedUpdateScript
const tags = ['server-ce', 'server-pro', 'saas']
const migrate = async () => {
await batchedUpdate(
'users',
{ 'features.templates': { $exists: true } },
{ $unset: { 'features.templates': true } }
)
}
const rollback = async () => {}
export default {
tags,
migrate,
rollback,
}