mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
eef5cd00e3
[migrations] delete unused collections and properly apply saml indexes GitOrigin-RevId: eafcde98cbb603c275986a5bca708b9f8221877f
29 lines
690 B
JavaScript
29 lines
690 B
JavaScript
const Helpers = require('./lib/helpers')
|
|
|
|
exports.tags = ['saas']
|
|
|
|
const unusedCollections = [
|
|
'collaberatorcount',
|
|
'db.subscriptions',
|
|
'projectsDeletedByMigration',
|
|
'readonlycount',
|
|
'samllog',
|
|
'sharelatex-production.docOps.2013-12-17T02-26-49.0',
|
|
'sharelatex-production.projects.2013-12-17T02-26-49.1',
|
|
'sharelatex-production.users.2013-12-17T02-26-49.2',
|
|
'sharelatex_production.users',
|
|
'totalwords',
|
|
'user',
|
|
'usersDeletedByMigration',
|
|
'usersEmailDomains',
|
|
]
|
|
|
|
exports.migrate = async () => {
|
|
for (const name of unusedCollections) {
|
|
await Helpers.dropCollection(name)
|
|
}
|
|
}
|
|
|
|
exports.rollback = async () => {
|
|
// We lost the indexes. There is no way back.
|
|
}
|