mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
25a0ea8752
Add migrations for new project property: `tokens.readAndWritePrefix` GitOrigin-RevId: 276a9e53533ae76e04e20fd94234f65999874662
23 lines
485 B
JavaScript
23 lines
485 B
JavaScript
const mongojs = require('../../app/js/infrastructure/mongojs')
|
|
const { db } = mongojs
|
|
|
|
const keys = { 'tokens.readAndWritePrefix': 1 }
|
|
const opts = {
|
|
unique: true,
|
|
partialFilterExpression: {
|
|
'tokens.readAndWritePrefix': { $exists: true }
|
|
},
|
|
background: true
|
|
}
|
|
|
|
console.log(
|
|
`>> Creating index on ${JSON.stringify(keys)}, ${JSON.stringify(opts)}`
|
|
)
|
|
|
|
db.projects.createIndex(keys, opts, err => {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
console.log('>> done')
|
|
process.exit(0)
|
|
})
|