overleaf/services/web/migrations/20220105123000_cleanup_unused_collections.js
Liangjun Song b69ff9417a Merge pull request #20731 from overleaf/revert-20480-ls-convert-migration-scripts-to-esm
Revert "Convert migration scripts to ESM"

GitOrigin-RevId: ca9ddda6ddee8964f72797d3b653ef9cee6a7a49
2024-10-14 10:57:02 +00:00

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.
}