mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add an update_user_features
migration.
This commit is contained in:
parent
78008cd2a6
commit
cc878e4caf
1 changed files with 32 additions and 0 deletions
32
server-ce/migrations/4_update_user_features.coffee
Normal file
32
server-ce/migrations/4_update_user_features.coffee
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
Settings = require "settings-sharelatex"
|
||||||
|
fs = require("fs")
|
||||||
|
mongojs = require("mongojs")
|
||||||
|
ObjectId = mongojs.ObjectId
|
||||||
|
db = mongojs(Settings.mongo.url, ['users'])
|
||||||
|
_ = require("underscore")
|
||||||
|
BSON = db.bson.BSON
|
||||||
|
|
||||||
|
handleExit = () ->
|
||||||
|
console.log('Got signal. Shutting down.')
|
||||||
|
|
||||||
|
process.on 'SIGINT', handleExit
|
||||||
|
process.on 'SIGHUP', handleExit
|
||||||
|
|
||||||
|
module.exports.migrate = (client, done=()->) ->
|
||||||
|
patch = {
|
||||||
|
$set: {
|
||||||
|
features: {
|
||||||
|
collaborators: -1
|
||||||
|
dropbox: true
|
||||||
|
versioning: true
|
||||||
|
references: true
|
||||||
|
templates: true
|
||||||
|
compileTimeout: 180
|
||||||
|
compileGroup: "standard"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log ">> updating all user features: ", patch
|
||||||
|
db.users.update {}, patch, {multi: true}, (err) ->
|
||||||
|
console.log "finished updating all user features"
|
||||||
|
return done(err)
|
Loading…
Reference in a new issue