2023-11-21 09:14:57 -05:00
|
|
|
/* eslint-disable no-unused-vars */
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
import Helpers from './lib/helpers.mjs'
|
2023-11-21 09:14:57 -05:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = ['server-ce', 'server-pro', 'saas']
|
2023-11-21 09:14:57 -05:00
|
|
|
|
|
|
|
const index = {
|
|
|
|
key: {
|
|
|
|
'data.user_id': 1,
|
|
|
|
},
|
|
|
|
name: 'data.user_id_1',
|
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const migrate = async client => {
|
2023-11-21 09:14:57 -05:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.addIndexesToCollection(db.tokens, [index])
|
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const rollback = async client => {
|
2023-11-21 09:14:57 -05:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.dropIndexesFromCollection(db.tokens, [index])
|
|
|
|
}
|
2024-10-02 05:32:13 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
tags,
|
|
|
|
migrate,
|
|
|
|
rollback,
|
|
|
|
}
|