go-algorand icon indicating copy to clipboard operation
go-algorand copied to clipboard

Update trackerDB schema migration

Open algorandskiy opened this issue 2 years ago • 1 comments

Probably not useful for this PR, but maybe in the future it would be.

There are some utilities added with the participation registry to fill in the boilerplate for these sorts of migrations. You pass an array of Migration functions and it handles the versioning and calling the correct subset of migration handlers.

https://github.com/algorand/go-algorand/blob/master/util/db/initialize.go#L34

At one point I converted the accountDB to use the new utilities, it was mostly straightforward: https://github.com/winder/go-algorand/pull/3/files#

Originally posted by @winder in https://github.com/algorand/go-algorand/pull/4003#discussion_r898450194

Not needed after switching from SQLite to KV.

algorandskiy avatar Jun 28 '22 21:06 algorandskiy

As note in the comment we might use this https://github.com/algorand/go-algorand/blob/master/util/db/initialize.go#L34 to rewrite migrations and simplify the code.

algorandskiy avatar Aug 02 '22 15:08 algorandskiy