Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub
overleaf
Commits
42d48b71
Commit
42d48b71
authored
Dec 02, 2016
by
Shane Kilkelly
Browse files
Add an `update_user_features` migration.
parent
59f312fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
migrations/4_update_user_features.coffee
0 → 100644
View file @
42d48b71
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment