diff --git a/package-lock.json b/package-lock.json index 8a8a2d3..c0a1c10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12609,12 +12609,6 @@ "minimatch": "^3.0.4" } }, - "node_modules/immediate": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", - "extraneous": true - }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -39893,11 +39887,6 @@ "minimatch": "^3.0.4" } }, - "immediate": { - "version": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", - "extraneous": true - }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", diff --git a/src/migrations/0.21-0.22.js b/src/migrations/0.21-0.22.js index 8f31554..114a465 100644 --- a/src/migrations/0.21-0.22.js +++ b/src/migrations/0.21-0.22.js @@ -6,7 +6,7 @@ const logger = Logger.create('orbit-db') Logger.setLogLevel('ERROR') export default async function migrate (OrbitDB, options, dbAddress) { - let oldCache = OrbitDB.caches[options.directory] ? OrbitDB.caches[options.directory].cache : null + let oldCache = options.cache || (OrbitDB.caches[options.directory] ? OrbitDB.caches[options.directory].cache : null) let oldStore if (!oldCache) { diff --git a/test/create-open.test.js b/test/create-open.test.js index d98cbff..72a5594 100644 --- a/test/create-open.test.js +++ b/test/create-open.test.js @@ -152,7 +152,7 @@ Object.keys(testAPIs).forEach(API => { await db2.close() }) - it.skip('loads cache from previous version of orbit-db', async () => { + it('loads cache from previous version of orbit-db', async () => { const dbName = 'cache-schema-test' db = await orbitdb.create(dbName, 'keyvalue', { overwrite: true }) @@ -164,14 +164,14 @@ Object.keys(testAPIs).forEach(API => { await db.drop() await fs.copy(migrationFixturePath, migrationDataPath, { filter: filterFunc }) - db = await orbitdb.create(dbName, 'keyvalue') + db = await orbitdb.create(dbName, 'keyvalue', { directory: migrationDataPath, overwrite: true }) await db.load() assert.equal(manifestHash, db.address.root) assert.equal((await db.get('key')), 'value') }) - it.skip('loads cache from previous version of orbit-db with the directory option', async () => { + it('loads cache from previous version of orbit-db with the directory option', async () => { const dbName = 'cache-schema-test' const directory = path.join(dbPath, "some-other-place")