Skip to content
Snippets Groups Projects
Unverified Commit 5679c97a authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Improve performance migration

parent 8f70ba23
No related branches found
No related tags found
No related merge requests found
...@@ -36,11 +36,9 @@ class MigrationCommand extends Command ...@@ -36,11 +36,9 @@ class MigrationCommand extends Command
// v3.2 // v3.2
'db.Configuration.updateMany({}, {$set: {"user.loginWithLesCommuns": true, "user.loginWithLesGoogle": true, "user.loginWithFacebook": true}});', 'db.Configuration.updateMany({}, {$set: {"user.loginWithLesCommuns": true, "user.loginWithLesGoogle": true, "user.loginWithFacebook": true}});',
'db.Option.updateMany({}, {$set: {osmTags: {}}})', 'db.Option.updateMany({}, {$set: {osmTags: {}}})',
'db.Element.find({ privateData: { $exists: true, $ne: {} } }).forEach(function(e) { 'var mapping = {};
for(var prop in e.privateData) { e.data[prop] = e.privateData[prop]; } db.Element.find({ privateData: { $exists: true, $ne: {} } }).forEach(function(doc){Object.keys(doc.privateData).forEach(function(key){mapping["privateData." + key]="data." + key})});
delete e.privateData; db.Element.updateMany({ privateData: { $exists: true, $ne: {} } }, {$rename: mapping})'
db.Element.save(e);
});'
]; ];
public static $commands = [ public static $commands = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment