20220105130000_fix_saml_indexes.js 623 B

12345678910111213141516171819
  1. const Helpers = require('./lib/helpers')
  2. const { samlLogsIndexes } = require('./20191106102104_saml-log-indexes')
  3. const { usersIndexes } = require('./20191107191318_saml-indentifiers-index')
  4. exports.tags = ['saas']
  5. exports.migrate = async ({ db }) => {
  6. // Fix-up the previous SAML migrations that were operating on collections with
  7. // typos in their names.
  8. await Helpers.addIndexesToCollection(
  9. db.users,
  10. usersIndexes.map(index => {
  11. return Object.assign({}, index, { unique: true })
  12. })
  13. )
  14. await Helpers.addIndexesToCollection(db.samlLogs, samlLogsIndexes)
  15. }
  16. exports.rollback = async () => {}