mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-09 09:09:02 +02:00
Merge pull request #18906 from overleaf/em-migrate-existing-histories-2
History ranges migration script - second attempt GitOrigin-RevId: 60a2c04e2a72e76a58e9e179fefc4186a96fde32
This commit is contained in:
@@ -64,9 +64,11 @@ const ProjectOptionsHandler = {
|
||||
return Project.updateOne(conditions, update, {})
|
||||
},
|
||||
|
||||
async enableHistoryRangesSupport(projectId) {
|
||||
async setHistoryRangesSupport(projectId, enabled) {
|
||||
const conditions = { _id: new ObjectId(projectId) }
|
||||
const update = { $set: { 'overleaf.history.rangesSupportEnabled': true } }
|
||||
const update = {
|
||||
$set: { 'overleaf.history.rangesSupportEnabled': enabled },
|
||||
}
|
||||
// NOTE: Updating the Mongoose model with the same query doesn't work. Maybe
|
||||
// because rangesSupportEnabled is not part of the schema?
|
||||
return db.projects.updateOne(conditions, update)
|
||||
@@ -83,8 +85,8 @@ module.exports = {
|
||||
unsetBrandVariationId: callbackify(
|
||||
ProjectOptionsHandler.unsetBrandVariationId
|
||||
),
|
||||
enableHistoryRangesSupport: callbackify(
|
||||
ProjectOptionsHandler.enableHistoryRangesSupport
|
||||
setHistoryRangesSupport: callbackify(
|
||||
ProjectOptionsHandler.setHistoryRangesSupport
|
||||
),
|
||||
promises: ProjectOptionsHandler,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user