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
65d21f71
Commit
65d21f71
authored
May 17, 2017
by
Shane Kilkelly
Browse files
Add migration to enable trackChanges for all users
parent
1f30aa53
Changes
1
Hide whitespace changes
Inline
Side-by-side
migrations/6_add_track_changes_feature.coffee
0 → 100644
View file @
65d21f71
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
exports
.
migrate
=
(
client
,
done
=
()
->
)
->
patch
=
{
$set
:
{
'features.trackChanges'
:
true
}
}
console
.
log
">> enabling trackChanges feature: "
,
patch
db
.
users
.
update
{},
patch
,
{
multi
:
true
},
(
err
)
->
console
.
log
"finished enabling trackChanges feature"
return
done
(
err
)
exports
.
rollback
=
(
client
,
done
)
->
done
()
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