From 30e83fdabeb85f5ecbc4f86e463a5e0b598e6904 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 3 Mar 2014 10:17:11 -0500 Subject: [PATCH] fixing upgrade script if order is not set --- src/upgrade.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/upgrade.js b/src/upgrade.js index 6aad843f05..0876aa7113 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -864,6 +864,12 @@ Upgrade.upgrade = function(callback) { if(err) { return next(err); } + + // If there was no order present, put it at the end + if (!order) { + order = cids.length; + } + db.sortedSetAdd('categories:cid', order, cid, next); }); }, function(err) {