mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-11 17:56:55 -05:00
9e15c73228
Revert "Revert "Convert migration scripts to ESM"" GitOrigin-RevId: 0430a3cd02b9d23bf0f4573346351dcf4ee17fa6
30 lines
511 B
JavaScript
30 lines
511 B
JavaScript
import Helpers from './lib/helpers.mjs'
|
|
|
|
const tags = ['saas']
|
|
|
|
const indexes = [
|
|
{
|
|
key: {
|
|
userId: 1,
|
|
dropboxId: 1,
|
|
},
|
|
unique: true,
|
|
name: 'userId_dropboxId_1',
|
|
},
|
|
]
|
|
|
|
const migrate = async client => {
|
|
const { db } = client
|
|
await Helpers.addIndexesToCollection(db.dropboxProjects, indexes)
|
|
}
|
|
|
|
const rollback = async client => {
|
|
const { db } = client
|
|
await Helpers.dropIndexesFromCollection(db.dropboxProjects, indexes)
|
|
}
|
|
|
|
export default {
|
|
tags,
|
|
migrate,
|
|
rollback,
|
|
}
|