From 93b8a9b13d502eae99573ffeccfd06a8e6b8314c Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 6 Sep 2017 09:56:44 +0100 Subject: [PATCH] Fix the doc lines migration. - The bson module changed at some point, update to new api --- .../migrations/1_move_doc_lines_to_doc_collection.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee b/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee index 8712cf9f54..e4433de7bd 100644 --- a/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee +++ b/server-ce/migrations/1_move_doc_lines_to_doc_collection.coffee @@ -1,4 +1,6 @@ Settings = require "settings-sharelatex" +bson = require('bson') +BSON = new bson() fs = require("fs") mongojs = require("mongojs") ObjectId = mongojs.ObjectId @@ -61,7 +63,7 @@ getAllDocs = (project_id, callback = (error, docs) ->) -> if !project? console.log "no such project #{project_id}" return callback() - size = require("../node_modules/mongojs/node_modules/mongodb/node_modules/bson/").BSONPure.BSON.calculateObjectSize(project) + size = BSON.calculateObjectSize(project) if size > 12000000 #12mb return markProjectAsToLargeAndFinished project_id, callback findAllDocsInProject project, (error, docs) ->