falsepositives migration (2nd round)
This commit is contained in:
parent
7886c1227e
commit
b6accbadef
1 changed files with 14 additions and 0 deletions
|
|
@ -209,6 +209,20 @@ Meteor.startup(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Migrations.add({
|
||||||
|
version: 16,
|
||||||
|
up: function moveToFalsePositivesUppercaseWithUser() {
|
||||||
|
const falsepositiveslower = new Mongo.Collection('falsepositives', { idGeneration: 'MONGO' });
|
||||||
|
falsepositiveslower.find({}).forEach((falseDoc) => {
|
||||||
|
const user = Meteor.users.findOne({ telegramChatId: falseDoc.chatId });
|
||||||
|
if (user) {
|
||||||
|
falseDoc.owner= user._id;
|
||||||
|
}
|
||||||
|
FalsePositives.insert(falseDoc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Set createdAt in users & subs
|
// Set createdAt in users & subs
|
||||||
Migrations.migrateTo('latest');
|
Migrations.migrateTo('latest');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue