20190912145006_create_docOps_indexes.js 502 B

1234567891011121314151617181920212223
  1. const Helpers = require('./lib/helpers')
  2. exports.tags = ['server-ce', 'server-pro', 'saas']
  3. const indexes = [
  4. {
  5. unique: true,
  6. key: {
  7. doc_id: 1,
  8. },
  9. name: 'doc_id_1',
  10. },
  11. ]
  12. exports.migrate = async ({ nativeDb }) => {
  13. const docOps = nativeDb.collection('docOps')
  14. await Helpers.addIndexesToCollection(docOps, indexes)
  15. }
  16. exports.rollback = async ({ nativeDb }) => {
  17. const docOps = nativeDb.collection('docOps')
  18. await Helpers.dropIndexesFromCollection(docOps, indexes)
  19. }