2024-10-02 05:32:13 -04:00
|
|
|
import Helpers from './lib/helpers.mjs'
|
2024-01-16 04:17:28 -05:00
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const tags = ['saas']
|
2024-01-16 04:17:28 -05:00
|
|
|
|
|
|
|
const index = {
|
|
|
|
key: {
|
|
|
|
oauthApplication_id: 1,
|
|
|
|
},
|
|
|
|
name: 'oauthApplication_id_1',
|
|
|
|
partialFilterExpression: {
|
|
|
|
oauthApplication_id: {
|
|
|
|
$exists: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const migrate = async client => {
|
2024-01-16 04:17:28 -05:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.addIndexesToCollection(db.oauthAccessTokens, [index])
|
|
|
|
}
|
|
|
|
|
2024-10-02 05:32:13 -04:00
|
|
|
const rollback = async client => {
|
2024-01-16 04:17:28 -05:00
|
|
|
const { db } = client
|
|
|
|
await Helpers.dropIndexesFromCollection(db.oauthAccessTokens, [index])
|
|
|
|
}
|
2024-10-02 05:32:13 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
tags,
|
|
|
|
migrate,
|
|
|
|
rollback,
|
|
|
|
}
|