20260420120000_create_libraryReferences_userId_updatedAt_index.mjs 482 B

1234567891011121314151617181920212223242526
  1. import Helpers from './lib/helpers.mjs'
  2. const tags = ['saas']
  3. const indexes = [
  4. {
  5. key: { userId: 1, updatedAt: 1 },
  6. name: 'userId_1_updatedAt_1',
  7. },
  8. ]
  9. const migrate = async client => {
  10. const { db } = client
  11. await Helpers.addIndexesToCollection(db.libraryReferences, indexes)
  12. }
  13. const rollback = async client => {
  14. const { db } = client
  15. await Helpers.dropIndexesFromCollection(db.libraryReferences, indexes)
  16. }
  17. export default {
  18. tags,
  19. migrate,
  20. rollback,
  21. }