Files
overleaf-cep/tools/migrations/20260717120000_create_libraryReferences_key_index.mjs
T
Eric Mc Sween c55411ee99 Merge pull request #36802 from overleaf/em-migrations-auxiliary-tags
[migrations] tag the auxiliary library migrations for saas

GitOrigin-RevId: cfe1169af24b36d6dcb352b4e0f79b250d74a1a0
2026-09-17 12:02:53 +00:00

29 lines
639 B
JavaScript

import Helpers from './lib/helpers.mjs'
const tags = ['saas', 'auxiliary']
// Backs an exact/prefix-range lookup on the raw citation key, used to suggest
// a unique citation key when auto-generating one from author/year.
const newIndexes = [
{
key: { userId: 1, key: 1 },
name: 'userId_1_key_1',
},
]
const migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.libraryReferences, newIndexes)
}
const rollback = async client => {
const { db } = client
await Helpers.dropIndexesFromCollection(db.libraryReferences, newIndexes)
}
export default {
tags,
migrate,
rollback,
}