mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: old upgrade script so it doesn't create settings objects
if they don't exist
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
'use strict';
|
||||
|
||||
const db = require('../../database');
|
||||
const user = require('../../user');
|
||||
const batch = require('../../batch');
|
||||
|
||||
module.exports = {
|
||||
@@ -18,7 +17,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
await batch.processSortedSet(`users:joindate`, async (uids) => {
|
||||
const userSettings = await user.getMultipleUserSettings(uids);
|
||||
const userSettings = await db.getObjects(uids.map(uid => `user:${uid}:settings`));
|
||||
const change = userSettings.filter(s => s && s.categoryWatchState === 'watching');
|
||||
await db.setObjectBulk(
|
||||
change.map(s => [`user:${s.uid}:settings`, { categoryWatchState: 'tracking' }])
|
||||
|
||||
Reference in New Issue
Block a user