20230616153016_user_features_updated_at_index.mjs 483 B

12345678910111213141516171819202122232425262728
  1. /* eslint-disable no-unused-vars */
  2. import Helpers from './lib/helpers.mjs'
  3. const tags = ['saas']
  4. const index = {
  5. key: {
  6. featuresUpdatedAt: 1,
  7. },
  8. name: 'featuresUpdatedAt_1',
  9. }
  10. const migrate = async client => {
  11. const { db } = client
  12. await Helpers.addIndexesToCollection(db.users, [index])
  13. }
  14. const rollback = async client => {
  15. const { db } = client
  16. await Helpers.dropIndexesFromCollection(db.users, [index])
  17. }
  18. export default {
  19. tags,
  20. migrate,
  21. rollback,
  22. }