Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit de6527e

Browse files
committed
Adding documentation for ignoreLock and options parameters
License: MIT Signed-off-by: Adam Uhlir <uhlir.a@gmail.com>
1 parent 6dc649b commit de6527e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ _Do not confuse this function with the `require('ipfs-repo-migrations').migrate(
109109

110110
Arguments:
111111
* `repoPath` (string) - absolute path to the root of the repo
112+
* `options` (object, optional) - object containing `IPFSRepo` options, that should be used to construct datastore instance.
112113
* `isBrowser` (bool) - indicates if the migration is run in browser environment in oppose to NodeJS
113114

114115
##### `revert(repoPath, isBrowser)`
@@ -117,6 +118,7 @@ _Do not confuse this function with the `require('ipfs-repo-migrations').revert()
117118

118119
Arguments:
119120
* `repoPath` (string) - path to the root of the repo
121+
* `options` (object, optional) - object containing `IPFSRepo` options, that should be used to construct datastore instance.
120122
* `isBrowser` (bool) - indicates if the migration is run in browser environment in oppose to NodeJS
121123

122124
#### Browser vs. NodeJS environments
@@ -183,14 +185,16 @@ This will create empty migration with next version in line.
183185

184186
## API
185187

186-
### `migrate(path[, toVersion[, progressCb[, isDryRun]]]) -> Promise<void>`
188+
### `migrate(path[, toVersion[, ignoreLock[, options[, progressCb[, isDryRun]]]]]) -> Promise<void>`
187189

188190
Executes forward migration to specific version or if not specified to the latest version.
189191

190192
**Arguments:**
191193

192194
* `path` (string, mandatory) - path to the repo to be migrated
193195
* `toVersion` (int, optional) - version to which the repo should be migrated to. If left out the version of latest migration is used.
196+
* `ignoreLock` (bool, optional) - if true won't lock the repo for applying the migrations. Use with caution.
197+
* `options` (object, optional) - options that are passed to migrations, that use them to correctly construct datastore. Options are same like for IPFSRepo.
194198
* `progressCb` (function, optional) - callback that is called after finishing execution of each migration to report progress.
195199
* `isDryRun` (bool, optional) - flag that indicates if it is a dry run that should imitate running migration without actually any change.
196200

@@ -203,14 +207,16 @@ Signature of the progress callback.
203207
* `counter` (int) - current number of migration in the planned migrations streak.
204208
* `totalMigrations` (int) - total count of migrations that are planned to be run.
205209

206-
### `revert(path, toVersion[, progressCb[, isDryRun]]) -> Promise<void>`
210+
### `revert(path, toVersion[, ignoreLock[, options[, progressCb[, isDryRun]]]]) -> Promise<void>`
207211

208212
Executes backward migration to specific version.
209213

210214
**Arguments:**
211215

212216
* `path` (string, mandatory) - path to the repo to be reverted
213217
* `toVersion` (int, mandatory) - version to which the repo should be reverted to.
218+
* `ignoreLock` (bool, optional) - if true won't lock the repo for applying the migrations. Use with caution.
219+
* `options` (object, optional) - options that are passed to migrations, that use them to correctly construct datastore. Options are same like for IPFSRepo.
214220
* `progressCb` (function, optional) - callback that is called after finishing execution of each migration to report progress.
215221
* `isDryRun` (bool, optional) - flag that indicates if it is a dry run that should imitate running migration without actually any change.
216222

0 commit comments

Comments
 (0)