Skip to content

Commit

Permalink
sqlite: add migration to drop registry columns from v2
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Sep 1, 2024
1 parent 5f8e3b7 commit 1c595e4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 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 @@ -83,6 +90,8 @@ CREATE TABLE contracts_v2 (
ingress_revenue BLOB NOT NULL,
egress_revenue BLOB NOT NULL,
account_funding BLOB NOT NULL,
registry_read BLOB NOT NULL,
registry_write BLOB NOT NULL,
risked_collateral BLOB NOT NULL,
raw_revision BLOB NOT NULL, -- binary serialized contract revision
confirmation_index BLOB, -- null if the contract has not been confirmed on the blockchain, otherwise the chain index of the block containing the confirmation transaction
Expand Down Expand Up @@ -913,4 +922,5 @@ var migrations = []func(tx *txn, log *zap.Logger) error{
migrateVersion27,
migrateVersion28,
migrateVersion29,
migrateVersion30,
}

0 comments on commit 1c595e4

Please sign in to comment.