2024-10-02 05:32:13 -04:00
|
|
|
import Helpers from './lib/helpers.mjs'
|
2023-04-27 06:22:29 -04:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = ['server-ce', 'server-pro', 'saas']
|
2023-04-27 06:22:29 -04:00
|
|
|
|
|
|
|
const indexes = [
|
|
|
|
{
|
|
|
|
key: { user_id: 1 },
|
|
|
|
name: 'pat_user_id_1',
|
|
|
|
partialFilterExpression: { type: 'pat' },
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const migrate = async client => {
|
2023-04-27 06:22:29 -04:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.addIndexesToCollection(db.oauthAccessTokens, indexes)
|
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const rollback = async client => {
|
2023-04-27 06:22:29 -04:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.dropIndexesFromCollection(db.oauthAccessTokens, indexes)
|
|
|
|
}
|
2024-10-02 05:32:13 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
tags,
|
|
|
|
migrate,
|
|
|
|
rollback,
|
|
|
|
}
|