MCPcopy Index your code
hub / github.com/apache/pouchdb / doMigrationTwo

Function doMigrationTwo

lib/index.js:6486–6599  ·  view source on GitHub ↗
(db, stores, callback)

Source from the content-addressed store, hash-verified

6484 });
6485};
6486var doMigrationTwo = function (db, stores, callback) {
6487 var batches = [];
6488 stores.bySeqStore.get(UUID_KEY$1, function (err, value) {
6489 if (err) {
6490 // no uuid key, so don't need to migrate;
6491 return callback();
6492 }
6493 batches.push({
6494 key: UUID_KEY$1,
6495 value,
6496 prefix: stores.metaStore,
6497 type: 'put',
6498 valueEncoding: 'json'
6499 });
6500 batches.push({
6501 key: UUID_KEY$1,
6502 prefix: stores.bySeqStore,
6503 type: 'del'
6504 });
6505 stores.bySeqStore.get(DOC_COUNT_KEY$1, function (err, value) {
6506 if (value) {
6507 // if no doc count key,
6508 // just skip
6509 // we can live with this
6510 batches.push({
6511 key: DOC_COUNT_KEY$1,
6512 value,
6513 prefix: stores.metaStore,
6514 type: 'put',
6515 valueEncoding: 'json'
6516 });
6517 batches.push({
6518 key: DOC_COUNT_KEY$1,
6519 prefix: stores.bySeqStore,
6520 type: 'del'
6521 });
6522 }
6523 stores.bySeqStore.get(UPDATE_SEQ_KEY$1, function (err, value) {
6524 if (value) {
6525 // if no UPDATE_SEQ_KEY
6526 // just skip
6527 // we've gone to far to stop.
6528 batches.push({
6529 key: UPDATE_SEQ_KEY$1,
6530 value,
6531 prefix: stores.metaStore,
6532 type: 'put',
6533 valueEncoding: 'json'
6534 });
6535 batches.push({
6536 key: UPDATE_SEQ_KEY$1,
6537 prefix: stores.bySeqStore,
6538 type: 'del'
6539 });
6540 }
6541 var deletedSeqs = {};
6542 stores.docStore.createReadStream({
6543 startKey: '_',

Callers

nothing calls this directly

Calls 6

isLocalIdFunction · 0.70
nextFunction · 0.70
winningRevFunction · 0.70
formatSeqFunction · 0.70
getMethod · 0.45
batchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…