2024-10-02 05:32:13 -04:00
|
|
|
import Helpers from './lib/helpers.mjs'
|
2021-07-21 06:34:09 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = ['server-ce', 'server-pro', 'saas']
|
2021-07-21 06:34:09 -04:00
|
|
|
|
|
|
|
const indexes = [
|
|
|
|
{
|
|
|
|
unique: true,
|
|
|
|
key: {
|
|
|
|
doc_id: 1,
|
|
|
|
},
|
|
|
|
name: 'doc_id_1',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const migrate = async ({ nativeDb }) => {
|
2024-01-31 10:44:02 -05:00
|
|
|
const docOps = nativeDb.collection('docOps')
|
|
|
|
await Helpers.addIndexesToCollection(docOps, indexes)
|
2021-07-21 06:34:09 -04:00
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const rollback = async ({ nativeDb }) => {
|
2024-01-31 10:44:02 -05:00
|
|
|
const docOps = nativeDb.collection('docOps')
|
|
|
|
await Helpers.dropIndexesFromCollection(docOps, indexes)
|
2021-07-21 06:34:09 -04:00
|
|
|
}
|
2024-10-02 05:32:13 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
tags,
|
|
|
|
migrate,
|
|
|
|
rollback,
|
|
|
|
}
|