mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
25a0ea8752
Add migrations for new project property: `tokens.readAndWritePrefix` GitOrigin-RevId: 276a9e53533ae76e04e20fd94234f65999874662
31 lines
608 B
JavaScript
31 lines
608 B
JavaScript
const mongojs = require('../../app/js/infrastructure/mongojs')
|
|
const { db, ObjectId } = mongojs
|
|
const Async = require('async')
|
|
|
|
const projectIds = [
|
|
// put ids here
|
|
]
|
|
|
|
Async.eachLimit(
|
|
projectIds,
|
|
5,
|
|
(projectId, cb) => {
|
|
db.projects.update(
|
|
{ _id: ObjectId(projectId) },
|
|
{
|
|
$unset: { tokens: 1 },
|
|
$set: { publicAccesLevel: 'private' }
|
|
},
|
|
err => {
|
|
if (err) return cb(err)
|
|
console.log(`Deactivated tokens for ${projectId}`)
|
|
cb()
|
|
}
|
|
)
|
|
},
|
|
err => {
|
|
if (err) throw err
|
|
console.log('>> Done')
|
|
process.exit(0)
|
|
}
|
|
)
|