mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 02:35:20 -05:00
42 lines
762 B
JavaScript
42 lines
762 B
JavaScript
|
/* eslint-disable no-unused-vars */
|
||
|
|
||
|
const Helpers = require('./lib/helpers')
|
||
|
|
||
|
exports.tags = ['saas']
|
||
|
|
||
|
exports.migrate = async client => {
|
||
|
const { db } = client
|
||
|
db.subscriptions.updateMany(
|
||
|
{
|
||
|
'teamInvites.0': {
|
||
|
$exists: true,
|
||
|
},
|
||
|
},
|
||
|
[
|
||
|
{
|
||
|
$set: {
|
||
|
teamInvites: {
|
||
|
$map: {
|
||
|
input: '$teamInvites',
|
||
|
in: {
|
||
|
$mergeObjects: [
|
||
|
'$$this',
|
||
|
{
|
||
|
email: {
|
||
|
$toLower: '$$this.email',
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
]
|
||
|
)
|
||
|
}
|
||
|
|
||
|
exports.rollback = async client => {
|
||
|
// There is no way back.
|
||
|
}
|