2024-10-02 05:32:13 -04:00
|
|
|
import Helpers from './lib/helpers.mjs'
|
2022-08-30 07:09:39 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = ['saas']
|
2022-08-30 07:09:39 -04:00
|
|
|
|
|
|
|
const indexes = [
|
|
|
|
{
|
|
|
|
key: {
|
|
|
|
userId: 1,
|
|
|
|
dropboxId: 1,
|
|
|
|
},
|
|
|
|
unique: true,
|
|
|
|
name: 'userId_dropboxId_1',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const migrate = async client => {
|
2022-08-30 07:09:39 -04:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.addIndexesToCollection(db.dropboxProjects, indexes)
|
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const rollback = async client => {
|
2022-08-30 07:09:39 -04:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.dropIndexesFromCollection(db.dropboxProjects, indexes)
|
|
|
|
}
|
2024-10-02 05:32:13 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
tags,
|
|
|
|
migrate,
|
|
|
|
rollback,
|
|
|
|
}
|