20240115172206_oauth_issuer_index.mjs 563 B

12345678910111213141516171819202122232425262728293031
  1. import Helpers from './lib/helpers.mjs'
  2. const tags = ['saas']
  3. const index = {
  4. key: {
  5. oauthApplication_id: 1,
  6. },
  7. name: 'oauthApplication_id_1',
  8. partialFilterExpression: {
  9. oauthApplication_id: {
  10. $exists: true,
  11. },
  12. },
  13. }
  14. const migrate = async client => {
  15. const { db } = client
  16. await Helpers.addIndexesToCollection(db.oauthAccessTokens, [index])
  17. }
  18. const rollback = async client => {
  19. const { db } = client
  20. await Helpers.dropIndexesFromCollection(db.oauthAccessTokens, [index])
  21. }
  22. export default {
  23. tags,
  24. migrate,
  25. rollback,
  26. }