Skip to content

Commit

Permalink
Merge pull request #456 from SiaFoundation/nate/fix-v2-migration
Browse files Browse the repository at this point in the history
Remove registry columns from v2
  • Loading branch information
n8maninger authored Sep 1, 2024
2 parents 3a44e13 + c5335f7 commit 54f434e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/mattn/go-sqlite3 v1.14.22
github.com/shopspring/decimal v1.4.0
go.sia.tech/core v0.4.5-0.20240831170056-a91ba45f50d6
go.sia.tech/coreutils v0.3.1-0.20240831170413-70443a42b7b2
go.sia.tech/core v0.4.5
go.sia.tech/coreutils v0.3.1
go.sia.tech/jape v0.12.1
go.sia.tech/web/hostd v0.46.0
go.uber.org/goleak v1.3.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
go.sia.tech/core v0.4.5-0.20240831170056-a91ba45f50d6 h1:ad4dKiZnjumnAZvpy9x+yK+djIQIJYXjmazH5jxcweE=
go.sia.tech/core v0.4.5-0.20240831170056-a91ba45f50d6/go.mod h1:Zuq0Tn2aIXJyO0bjGu8cMeVWe+vwQnUfZhG1LCmjD5c=
go.sia.tech/coreutils v0.3.1-0.20240831170413-70443a42b7b2 h1:ibPgvT9ICWvKKqj7Avk6jpz1BgxyiFsKEJEPM+powzA=
go.sia.tech/coreutils v0.3.1-0.20240831170413-70443a42b7b2/go.mod h1:yI2eAuWhkjpSfDsgsczCkeruBkoc1guAI226ZzGqqZk=
go.sia.tech/core v0.4.5 h1:w2D3Mx29UmK1aFd9R7uHFo5JUSTqu3+92NHoRFv3CaU=
go.sia.tech/core v0.4.5/go.mod h1:Zuq0Tn2aIXJyO0bjGu8cMeVWe+vwQnUfZhG1LCmjD5c=
go.sia.tech/coreutils v0.3.1 h1:FLIBM4ryLFvwkZVv8Yyn3KZsUdqX6pX8moS3xfQX5M0=
go.sia.tech/coreutils v0.3.1/go.mod h1:qOBvtTS14Q2lSbY+S3u39AntpttL5kuIv7P8NktKYw0=
go.sia.tech/jape v0.12.1 h1:xr+o9V8FO8ScRqbSaqYf9bjj1UJ2eipZuNcI1nYousU=
go.sia.tech/jape v0.12.1/go.mod h1:wU+h6Wh5olDjkPXjF0tbZ1GDgoZ6VTi4naFw91yyWC4=
go.sia.tech/mux v1.2.0 h1:ofa1Us9mdymBbGMY2XH/lSpY8itFsKIo/Aq8zwe+GHU=
Expand Down
8 changes: 8 additions & 0 deletions persist/sqlite/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import (
"go.uber.org/zap"
)

func migrateVersion30(tx *txn, _ *zap.Logger) error {
_, err := tx.Exec(`
ALTER TABLE contracts_v2 DROP COLUMN registry_read;
ALTER TABLE contracts_v2 DROP COLUMN registry_write;`)
return err
}

// migrateVersion29 resets the chain state to trigger a full rescan of the
// wallet to calculate the new immature balance metric.
func migrateVersion29(tx *txn, _ *zap.Logger) error {
Expand Down Expand Up @@ -915,4 +922,5 @@ var migrations = []func(tx *txn, log *zap.Logger) error{
migrateVersion27,
migrateVersion28,
migrateVersion29,
migrateVersion30,
}

0 comments on commit 54f434e

Please sign in to comment.