mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[migrations] tag the auxiliary library migrations for saas GitOrigin-RevId: cfe1169af24b36d6dcb352b4e0f79b250d74a1a0
29 lines
639 B
JavaScript
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,
|
|
}
|