mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
24 lines
548 B
JavaScript
24 lines
548 B
JavaScript
// Internal ticket: https://github.com/overleaf/issues/issues/4094
|
|
|
|
const Settings = require('settings-sharelatex')
|
|
const mongojs = require('mongojs')
|
|
const db = mongojs(Settings.mongo.url, ['deletedFiles'])
|
|
|
|
const INDEX_NAME = 'projectId_1'
|
|
const INDEX_KEYS = { projectId: 1 }
|
|
const INDEX_OPTIONS = {
|
|
name: INDEX_NAME,
|
|
background: 1
|
|
}
|
|
|
|
exports.migrate = (client, done) => {
|
|
db.deletedFiles.ensureIndex(
|
|
INDEX_KEYS,
|
|
INDEX_OPTIONS,
|
|
done
|
|
)
|
|
}
|
|
|
|
exports.rollback = (client, done) => {
|
|
db.deletedFiles.dropIndex(INDEX_NAME, done)
|
|
}
|