diff --git a/services/web/migrations/20210924140139_splittests-name-index.js b/services/web/migrations/20210924140139_splittests-name-index.js new file mode 100644 index 0000000000..67d99e244f --- /dev/null +++ b/services/web/migrations/20210924140139_splittests-name-index.js @@ -0,0 +1,23 @@ +const Helpers = require('./lib/helpers') + +exports.tags = ['saas'] + +const indexes = [ + { + key: { + name: 1, + }, + unique: true, + name: 'name_1', + }, +] + +exports.migrate = async client => { + const { db } = client + await Helpers.addIndexesToCollection(db.splittests, indexes) +} + +exports.rollback = async client => { + const { db } = client + Helpers.dropIndexesFromCollection(db.splittests, indexes) +} diff --git a/services/web/migrations/lib/adapter.js b/services/web/migrations/lib/adapter.js index a254eac572..eb7757e2f4 100644 --- a/services/web/migrations/lib/adapter.js +++ b/services/web/migrations/lib/adapter.js @@ -28,6 +28,7 @@ class Adapter { await addCollection('projectImportFailures') await addCollection('samllog') await addCollection('user') + await addCollection('splittests') return { db } }