Skip to content

Commit

Permalink
feat: handle migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Oct 16, 2024
1 parent bcc61b1 commit 10b01d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 7 additions & 2 deletions internal/storage/bucket/migrations/29-logs-add-memento.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--todo: add migration
alter table "{{.Bucket}}".logs
add column memento bytea;
add column memento bytea;

update "{{.Bucket}}".logs
set memento = convert_to(data::varchar, 'LATIN1')::bytea;

alter table "{{.Bucket}}".logs
alter column memento set not null;
5 changes: 2 additions & 3 deletions internal/storage/ledger/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ func (s *Store) selectAccounts(date *time.Time, expandVolumes, expandEffectiveVo
ret = ret.Where(where)
}
}
fmt.Println(ret.String())

return ret
}
Expand Down Expand Up @@ -271,8 +270,8 @@ func (s *Store) UpdateAccountsMetadata(ctx context.Context, m map[string]metadat
accounts = append(accounts, AccountWithLedger{
Ledger: s.ledger.Name,
Account: ledger.Account{
Address: account,
Metadata: accountMetadata,
Address: account,
Metadata: accountMetadata,
},
})
}
Expand Down

0 comments on commit 10b01d7

Please sign in to comment.