scrub imported games and their analysis

pull/8661/head
Thibault Duplessis 2021-04-14 12:56:29 +02:00
parent 4bda5ec111
commit 5b72f1db36
1 changed files with 8 additions and 0 deletions

View File

@ -79,6 +79,14 @@ scrub('game5')(c =>
})
);
scrub('game5')(c => {
const importedIds = c.distinct('_id', { 'pgni.user': userId });
if (importedIds.length) {
c.remove({ 'pgni.user': userId });
scrub('analysis2')(a => a.remove({ _id: { $in: importedIds } }));
}
});
deleteAll('history3', '_id');
deleteAll('image', 'createdBy');