falsepositives migration (5rd round)
This commit is contained in:
parent
d538f8cd8e
commit
21531d1fd2
1 changed files with 4 additions and 0 deletions
|
|
@ -213,11 +213,15 @@ Meteor.startup(() => {
|
||||||
version: 16,
|
version: 16,
|
||||||
up: function moveToFalsePositivesUppercaseWithUser() {
|
up: function moveToFalsePositivesUppercaseWithUser() {
|
||||||
const falsepositiveslower = new Mongo.Collection('falsepositives', { idGeneration: 'MONGO' });
|
const falsepositiveslower = new Mongo.Collection('falsepositives', { idGeneration: 'MONGO' });
|
||||||
|
const now = new Date();
|
||||||
falsepositiveslower.find({}).forEach((falseDoc) => {
|
falsepositiveslower.find({}).forEach((falseDoc) => {
|
||||||
const user = Meteor.users.findOne({ telegramChatId: falseDoc.chatId });
|
const user = Meteor.users.findOne({ telegramChatId: falseDoc.chatId });
|
||||||
if (user) {
|
if (user) {
|
||||||
falseDoc.owner= user._id;
|
falseDoc.owner= user._id;
|
||||||
}
|
}
|
||||||
|
falseDoc.type = 'industry';
|
||||||
|
falseDoc.createdAt = now;
|
||||||
|
falseDoc.updatedAt = now;
|
||||||
FalsePositives.insert(falseDoc);
|
FalsePositives.insert(falseDoc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue