From accf48f38b5b6c6dc981f6c069056d3d336f9e63 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 27 Jun 2019 12:39:21 -0400 Subject: [PATCH] fix: upgrade script #7720 --- src/upgrades/1.12.3/user_pid_sets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/upgrades/1.12.3/user_pid_sets.js b/src/upgrades/1.12.3/user_pid_sets.js index 060595db0a..615d702c3c 100644 --- a/src/upgrades/1.12.3/user_pid_sets.js +++ b/src/upgrades/1.12.3/user_pid_sets.js @@ -18,7 +18,7 @@ module.exports = { let postData; async.waterfall([ function (next) { - posts.getPostsFields(pids, ['uid', 'tid', 'upvotes', 'downvotes', 'timestamp'], next); + posts.getPostsFields(pids, ['pid', 'uid', 'tid', 'upvotes', 'downvotes', 'timestamp'], next); }, function (_postData, next) { postData = _postData; @@ -28,7 +28,7 @@ module.exports = { function (topicData, next) { const bulk = []; postData.forEach(function (p, index) { - if (p && p.uid && p.tid) { + if (p && p.uid && p.pid && p.tid && p.timestamp) { bulk.push(['cid:' + topicData[index].cid + ':uid:' + p.uid + ':pids', p.timestamp, p.pid]); if (p.votes > 0) { bulk.push(['cid:' + topicData[index].cid + ':uid:' + p.uid + ':pids:votes', p.votes, p.pid]);