mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix problems with migrations and start firebase migration
This commit is contained in:
@@ -33,6 +33,7 @@ dbGroups.findEach({}, {_id: 1, members: 1}, {batchSize: 500}, function(err, grou
|
||||
countUsers++;
|
||||
console.log('User: ', countUsers);
|
||||
|
||||
// TODO updating the same group many times concurrently can cause problems?
|
||||
dbGroups.update({
|
||||
_id: group._id
|
||||
}, {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Remove emoty groups
|
||||
* Remove empty private groups
|
||||
*/
|
||||
|
||||
var mongo = require('mongoskin');
|
||||
@@ -13,7 +13,11 @@ var dbGroups = db.collection('groups');
|
||||
console.log('Begins work on db');
|
||||
|
||||
dbGroups.remove({
|
||||
members: {$size: 0}
|
||||
members: {$size: 0},
|
||||
$or: [
|
||||
{type: 'party'},
|
||||
{privacy: 'private'}
|
||||
]
|
||||
}, function(err, res){
|
||||
if(err) throw err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user