Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 9324aa4

Browse files
committed
Revert "Integration of ipfs-repo-migrations"
This reverts commit 78f69d7.
1 parent 1f6d1e5 commit 9324aa4

File tree

5 files changed

+0
-50
lines changed

5 files changed

+0
-50
lines changed

package-list.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
"Repo",
2020
["ipfs/js-ipfs-repo", "ipfs-repo"],
21-
["AuHau/js-ipfs-repo-migrations", "ipfs-repo-migrations"],
2221

2322
"Exchange",
2423
["ipfs/js-ipfs-block-service", "ipfs-block-service"],

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
"ipfs-mfs": "~0.11.4",
9999
"ipfs-multipart": "~0.1.0",
100100
"ipfs-repo": "~0.26.6",
101-
"ipfs-repo-migrations": "AuHau/js-ipfs-repo-migrations#dev",
102101
"ipfs-unixfs": "~0.1.16",
103102
"ipfs-unixfs-exporter": "~0.37.6",
104103
"ipfs-unixfs-importer": "~0.39.9",

src/core/boot.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,6 @@ module.exports = (self) => {
2727
cb(null, true)
2828
})
2929
},
30-
// If migrations are enabled check & migrate repo
31-
(repoOpened, cb) => {
32-
// There is non-initialized repo => no migrations needed
33-
if(!repoOpened){
34-
return cb(null, repoOpened)
35-
}
36-
37-
self.config.get('repoDisableAutoMigration')
38-
.catch(err => {
39-
if (!err.message.match('does not exist')) {
40-
return Promise.reject(err)
41-
}
42-
43-
// Option not found, but default value is false, lets continue
44-
return false
45-
})
46-
.then(repoDisableAutoMigration => {
47-
if (!repoDisableAutoMigration) {
48-
self.log('checking for migrations')
49-
return self.repo.migrate()
50-
}
51-
})
52-
.then(() => cb(null, repoOpened))
53-
.catch(cb)
54-
},
5530
(repoOpened, cb) => {
5631
// Init with existing initialized, opened, repo
5732
if (repoOpened) {

src/core/components/repo.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
const promisify = require('promisify-es6')
44
const repoVersion = require('ipfs-repo').repoVersion
5-
const log = require('debug')('ipfs:repo')
6-
const migrator = require('ipfs-repo-migrations')
75

86
module.exports = function repo (self) {
97
return {
@@ -40,26 +38,6 @@ module.exports = function repo (self) {
4038
})
4139
}),
4240

43-
migrate: async function tryMigrateRepo () {
44-
// Reads the repo version from datastore, not from the ipfs-repo package
45-
const currentRepoVersion = await migrator.getCurrentRepoVersion(self._repo.path)
46-
47-
if (currentRepoVersion >= repoVersion) {
48-
if (currentRepoVersion > repoVersion) {
49-
log('Your repo\'s version is higher then this version of js-ipfs require! You should revert it.')
50-
}
51-
52-
log('Nothing to migrate')
53-
return
54-
}
55-
56-
if (repoVersion > migrator.getLatestMigrationVersion()) {
57-
throw new Error('The ipfs-repo-migrations package does not have migration for version: ' + repoVersion)
58-
}
59-
60-
return migrator.migrate(self._repo.path, {toVersion: repoVersion, ignoreLock: true, repoOptions: self._repo.options})
61-
},
62-
6341
gc: promisify((options, callback) => {
6442
if (typeof options === 'function') {
6543
callback = options

src/core/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const s = superstruct({
2727
const configSchema = s({
2828
repo: optional(s('object|string')),
2929
repoOwner: 'boolean?',
30-
repoDisableAutoMigration: 'boolean?',
3130
preload: s({
3231
enabled: 'boolean?',
3332
addresses: optional(s(['multiaddr'])),

0 commit comments

Comments
 (0)