ipfs-repo-migrations
Advanced tools
Comparing version 5.0.2 to 5.0.3
@@ -0,1 +1,11 @@ | ||
<a name="5.0.3"></a> | ||
## [5.0.3](https://github.com/ipfs/js-ipfs-repo-migrations/compare/v5.0.2...v5.0.3) (2020-08-15) | ||
### Bug Fixes | ||
* pass repo options when migration error occurs ([267e718](https://github.com/ipfs/js-ipfs-repo-migrations/commit/267e718)) | ||
<a name="5.0.2"></a> | ||
@@ -2,0 +12,0 @@ ## [5.0.2](https://github.com/ipfs/js-ipfs-repo-migrations/compare/v5.0.1...v5.0.2) (2020-08-15) |
@@ -42,3 +42,10 @@ 'use strict' | ||
if (onProgress) { | ||
blockCount = await length(blockstore.query({ keysOnly: true })) | ||
blockCount = await length(blockstore.query({ | ||
keysOnly: true, | ||
filters: [({ key }) => { | ||
const newKey = keyFunction(key) | ||
return newKey.toString() !== key.toString() | ||
}] | ||
})) | ||
} | ||
@@ -45,0 +52,0 @@ |
{ | ||
"name": "ipfs-repo-migrations", | ||
"version": "5.0.2", | ||
"version": "5.0.3", | ||
"description": "Migration framework for versioning of JS IPFS Repo", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -32,3 +32,3 @@ # Migration tool for JS IPFS Repo <!-- omit in toc --> | ||
- [`.migrate(path, repoOptions, toVersion, {ignoreLock, onProgress, isDryRun}) -> Promise<void>`](#migratepath-repooptions-toversion-ignorelock-onprogress-isdryrun---promisevoid) | ||
- [`onProgress(versionFrom, versionTo, percent, message)`](#onprogressversionfrom-versionto-percent-message) | ||
- [`onProgress(version, percent, message)`](#onprogressversion-percent-message) | ||
- [`.revert(path, repoOptions, toVersion, {ignoreLock, onProgress, isDryRun}) -> Promise<void>`](#revertpath-repooptions-toversion-ignorelock-onprogress-isdryrun---promisevoid) | ||
@@ -122,6 +122,6 @@ - [`getLatestMigrationVersion() -> int`](#getlatestmigrationversion---int) | ||
* `options.ignoreLock` (bool, optional) - if true will not lock the repo when applying migrations. Use with caution. | ||
* `options.onProgress` (function, optional) - callback that is called after finishing execution of each migration to report progress. | ||
* `options.onProgress` (function, optional) - callback that is called during each migration to report progress. | ||
* `options.isDryRun` (bool, optional) - flag that indicates if it is a dry run that should give the same output as running a migration but without making any actual changes. | ||
#### `onProgress(versionFrom, versionTo, percent, message)` | ||
#### `onProgress(version, percent, message)` | ||
@@ -146,3 +146,3 @@ Signature of the progress callback. | ||
* `options.ignoreLock` (bool, optional) - if true will not lock the repo when applying migrations. Use with caution. | ||
* `options.onProgress` (function, optional) - callback that is called after finishing execution of each migration to report progress. | ||
* `options.onProgress` (function, optional) - callback that is called during each migration to report progress. | ||
* `options.isDryRun` (bool, optional) - flag that indicates if it is a dry run that should give the same output as running a migration but without making any actual changes. | ||
@@ -149,0 +149,0 @@ |
@@ -103,3 +103,3 @@ 'use strict' | ||
if (onProgress) { // eslint-disable-line max-depth | ||
progressCallback = (percent, message) => onProgress(currentVersion, migration.version, percent.toFixed(2), message) | ||
progressCallback = (percent, message) => onProgress(migration.version, percent.toFixed(2), message) | ||
} | ||
@@ -112,3 +112,3 @@ | ||
log(`An exception was raised during execution of migration. Setting the repo's version to last successfully migrated version: ${lastSuccessfullyMigratedVersion}`) | ||
await repoVersion.setVersion(path, lastSuccessfullyMigratedVersion) | ||
await repoVersion.setVersion(path, lastSuccessfullyMigratedVersion, repoOptions) | ||
@@ -208,3 +208,3 @@ e.message = `During migration to version ${migration.version} exception was raised: ${e.message}` | ||
if (onProgress) { // eslint-disable-line max-depth | ||
progressCallback = (percent, message) => onProgress(currentVersion, migration.version, percent.toFixed(2), message) | ||
progressCallback = (percent, message) => onProgress(migration.version, percent.toFixed(2), message) | ||
} | ||
@@ -211,0 +211,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
313710
846