mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
Merge pull request #5229 from overleaf/ab-splittest-name-index
Add migration to create unique index on splittests name GitOrigin-RevId: d7420ad714a09abedafb7462b51b3c403c9a026b
This commit is contained in:
committed by
Copybot
parent
ddc1a1d149
commit
2b591b8221
@@ -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)
|
||||
}
|
||||
@@ -28,6 +28,7 @@ class Adapter {
|
||||
await addCollection('projectImportFailures')
|
||||
await addCollection('samllog')
|
||||
await addCollection('user')
|
||||
await addCollection('splittests')
|
||||
|
||||
return { db }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user