Merge pull request #9291 from overleaf/jpa-dropbox-project-id

[third-party-datastore] tracking of dropboxId for project folder

GitOrigin-RevId: fd47441c81ba1a845dac6d34557ceed2dcbdd7fe
This commit is contained in:
Jakob Ackermann 2022-08-17 14:58:39 +01:00 committed by Copybot
parent 3538590559
commit 7225f3ea75
2 changed files with 25 additions and 0 deletions

View file

@ -39,6 +39,7 @@ async function setupDb() {
db.deletedSubscriptions = internalDb.collection('deletedSubscriptions')
db.deletedUsers = internalDb.collection('deletedUsers')
db.dropboxEntities = internalDb.collection('dropboxEntities')
db.dropboxProjects = internalDb.collection('dropboxProjects')
db.docHistory = internalDb.collection('docHistory')
db.docHistoryIndex = internalDb.collection('docHistoryIndex')
db.docOps = internalDb.collection('docOps')

View file

@ -0,0 +1,24 @@
const Helpers = require('./lib/helpers')
exports.tags = ['saas']
const indexes = [
{
key: {
userId: 1,
projectId: 1,
},
unique: true,
name: 'projectId_userId_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)
}