mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
b69ff9417a
Revert "Convert migration scripts to ESM" GitOrigin-RevId: ca9ddda6ddee8964f72797d3b653ef9cee6a7a49
30 lines
649 B
JavaScript
30 lines
649 B
JavaScript
const { batchedUpdate } = require('../scripts/helpers/batchedUpdate')
|
|
|
|
exports.tags = ['saas']
|
|
|
|
const batchedUpdateOptions = {
|
|
VERBOSE_LOGGING: 'true',
|
|
BATCH_SIZE: '1',
|
|
}
|
|
|
|
exports.migrate = async () => {
|
|
await batchedUpdate(
|
|
'users',
|
|
{ 'twoFactorAuthentication.secret': { $exists: true } },
|
|
{ $unset: { twoFactorAuthentication: true } },
|
|
null,
|
|
null,
|
|
batchedUpdateOptions
|
|
)
|
|
}
|
|
|
|
exports.rollback = async () => {
|
|
await batchedUpdate(
|
|
'users',
|
|
{ 'twoFactorAuthentication.secretEncrypted': { $exists: true } },
|
|
{ $unset: { twoFactorAuthentication: true } },
|
|
null,
|
|
null,
|
|
batchedUpdateOptions
|
|
)
|
|
}
|