Cht-core: Remove empty parents migration scalability

Created on 11 Aug 2016  路  8Comments  路  Source: medic/cht-core

The remove-empty-parents db migration attempts to download all contacts including docs and then process them one by one. On a large data set I expect this will crash.

Do some sort of batching instead (limit and skip), and use bulk docs to do the insertion.

Bug Upgrading

Most helpful comment

Assigning to @alxndrsn because I _think_ I saw him talk about this issue on Slack...

All 8 comments

Assigning to @alxndrsn because I _think_ I saw him talk about this issue on Slack...

Now using a temp view, similar to migrations/convert-bad-dob-format.js.

No limit or skip, and no bulk update, but should now only be getting a few docs per project, instead of _ALL_ the contacts.

Original issue: #2436

One comment in the commit. Also there are a few jshint errors to fix.

I've fixed jshint to unblock master.

No AT required.

Was this page helpful?
0 / 5 - 0 ratings