mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #10644 from overleaf/em-chunk-store-mongo
Mongo backend for the history chunk store GitOrigin-RevId: 8dcfc7e62065785616b7894009368b6acbb4428a
This commit is contained in:
parent
4589a57774
commit
3efcd3e52b
2 changed files with 28 additions and 0 deletions
|
@ -61,6 +61,7 @@ async function setupDb() {
|
|||
db.oauthApplications = internalDb.collection('oauthApplications')
|
||||
db.oauthAuthorizationCodes = internalDb.collection('oauthAuthorizationCodes')
|
||||
db.projectAuditLogEntries = internalDb.collection('projectAuditLogEntries')
|
||||
db.projectHistoryChunks = internalDb.collection('projectHistoryChunks')
|
||||
db.projectHistoryFailures = internalDb.collection('projectHistoryFailures')
|
||||
db.projectHistoryLabels = internalDb.collection('projectHistoryLabels')
|
||||
db.projectHistoryMetaData = internalDb.collection('projectHistoryMetaData')
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/* eslint-disable no-unused-vars */
|
||||
|
||||
const Helpers = require('./lib/helpers')
|
||||
|
||||
exports.tags = ['server-ce', 'server-pro', 'saas']
|
||||
|
||||
const indexes = [
|
||||
{
|
||||
key: { projectId: 1, startVersion: 1 },
|
||||
name: 'projectId_1_startVersion_1',
|
||||
partialFilterExpression: { state: 'active' },
|
||||
unique: true,
|
||||
},
|
||||
{
|
||||
key: { state: 1 },
|
||||
name: 'state_1',
|
||||
partialFilterExpression: { state: 'deleted' },
|
||||
},
|
||||
]
|
||||
|
||||
exports.migrate = async ({ db }) => {
|
||||
await Helpers.addIndexesToCollection(db.projectHistoryChunks, indexes)
|
||||
}
|
||||
|
||||
exports.rollback = async ({ db }) => {
|
||||
await Helpers.dropIndexesFromCollection(db.projectHistoryChunks, indexes)
|
||||
}
|
Loading…
Reference in a new issue