20250205145327_drop_rooms_projectId_index.mjs 513 B

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