2024-10-01 05:53:36 -04:00
|
|
|
const Helpers = require('./lib/helpers')
|
2022-01-10 06:36:18 -05:00
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.tags = ['saas']
|
2022-01-10 06:36:18 -05:00
|
|
|
|
|
|
|
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',
|
|
|
|
]
|
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.migrate = async () => {
|
2022-01-10 06:36:18 -05:00
|
|
|
for (const name of unusedCollections) {
|
|
|
|
await Helpers.dropCollection(name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-01 05:53:36 -04:00
|
|
|
exports.rollback = async () => {
|
2022-01-10 06:36:18 -05:00
|
|
|
// We lost the indexes. There is no way back.
|
|
|
|
}
|