mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-30 23:22:41 +00:00
23 lines
670 B
JavaScript
23 lines
670 B
JavaScript
const Settings = require('settings-sharelatex')
|
|
const mongojs = require('mongojs')
|
|
const db = mongojs(Settings.mongo.url, ['projects'])
|
|
|
|
exports.migrate = (client, done) => {
|
|
console.log(`>> Setting 'imageName' in projects`)
|
|
|
|
if (!Settings.currentImageName) {
|
|
console.log(`>> 'currentImageName' is not defined, no projects updated`)
|
|
return done()
|
|
}
|
|
|
|
console.log(`>> Setting 'imageName' = ${Settings.currentImageName}`)
|
|
|
|
db.projects.update(
|
|
{ imageName: { $exists: false } },
|
|
{ $set: { imageName: Settings.currentImageName } },
|
|
{ multi: true },
|
|
done
|
|
)
|
|
}
|
|
|
|
exports.rollback = (client, done) => done()
|