overleaf/services/web/migrations/20220817120900_create_dropboxProjects_index.js
Jakob Ackermann 55c1f852d6 Merge pull request #9447 from overleaf/jpa-dropbox-refresh-project-folder-names
[third-party-datastore] keep dropbox folder names up-to-date

GitOrigin-RevId: d82a6cb7b10ee2c81c5769d02896f65a347bbf67
2022-08-31 08:03:40 +00:00

24 lines
467 B
JavaScript

const Helpers = require('./lib/helpers')
exports.tags = ['saas']
const indexes = [
{
key: {
userId: 1,
dropboxId: 1,
},
unique: true,
name: 'userId_dropboxId_1',
},
]
exports.migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.dropboxProjects, indexes)
}
exports.rollback = async client => {
const { db } = client
await Helpers.dropIndexesFromCollection(db.dropboxProjects, indexes)
}