2024-10-02 05:32:13 -04:00
|
|
|
import Helpers from './lib/helpers.mjs'
|
2022-08-17 09:58:39 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = ['saas']
|
2022-08-17 09:58:39 -04:00
|
|
|
|
|
|
|
const indexes = [
|
|
|
|
{
|
|
|
|
key: {
|
|
|
|
userId: 1,
|
|
|
|
projectId: 1,
|
|
|
|
},
|
|
|
|
unique: true,
|
|
|
|
name: 'projectId_userId_1',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const migrate = async client => {
|
2022-08-17 09:58: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-17 09:58: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,
|
|
|
|
}
|