Skip to content

Commit

Permalink
Adds a no-op migration for metadata v3
Browse files Browse the repository at this point in the history
Signed-off-by: John Howard <[email protected]>
  • Loading branch information
John Howard committed Sep 12, 2018
1 parent f1cc4fe commit 8e44270
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion metadata/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
// dbVersion represents updates to the schema
// version which are additions and compatible with
// prior version of the same schema.
dbVersion = 2
dbVersion = 3
)

// DB represents a metadata database backed by a bolt
Expand Down
10 changes: 10 additions & 0 deletions metadata/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,16 @@ func TestMigrations(t *testing.T) {
return nil
},
},

{
name: "NoOp",
init: func(tx *bolt.Tx) error {
return nil
},
check: func(tx *bolt.Tx) error {
return nil
},
},
}

if len(migrationTests) != len(migrations) {
Expand Down
12 changes: 12 additions & 0 deletions metadata/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ var migrations = []migration{
version: 2,
migrate: migrateIngests,
},
{
schema: "v1",
version: 3,
migrate: noOpMigration,
},
}

// addChildLinks Adds children key to the snapshotters to enforce snapshot
Expand Down Expand Up @@ -154,3 +159,10 @@ func migrateIngests(tx *bolt.Tx) error {

return nil
}

// noOpMigration was for a database change from boltdb/bolt which is no
// longer being supported, to go.etcd.io/bbolt which is the currently
// maintained repo for boltdb.
func noOpMigration(tx *bolt.Tx) error {
return nil
}

0 comments on commit 8e44270

Please sign in to comment.