2024-10-01 05:53:36 -04:00
|
|
|
const Helpers = require('./lib/helpers')
|
2022-08-17 09:58:39 -04:00
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.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-01 05:53:36 -04:00
|
|
|
exports.migrate = async client => {
|
2022-08-17 09:58:39 -04:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.addIndexesToCollection(db.dropboxProjects, indexes)
|
|
|
|
}
|
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.rollback = async client => {
|
2022-08-17 09:58:39 -04:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.dropIndexesFromCollection(db.dropboxProjects, indexes)
|
|
|
|
}
|