Skip to content

Commit

Permalink
fix: add missing insert to migration
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcgary committed Jan 15, 2025
1 parent f0185a9 commit 857e48c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/postgres/migrations/202501151039_rewardsClaimed/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (m *Migration) Up(db *sql.DB, grm *gorm.DB, cfg *config.Config) error {
return res.Error
}
query = `
insert into rewards_claimed (root, token, claimed_amount, earner, claimer, recipient, transaction_hash, block_number, log_index)
select
concat('0x', (
SELECT lower(string_agg(lpad(to_hex(elem::int), 2, '0'), ''))
Expand All @@ -48,6 +49,7 @@ func (m *Migration) Up(db *sql.DB, grm *gorm.DB, cfg *config.Config) error {
tl.address = @rewardsCoordinatorAddress
and tl.event_name = 'RewardsClaimed'
order by tl.block_number asc
on conflict do nothing
`
contractAddresses := cfg.GetContractsMapForChain()
res = grm.Exec(query, sql.Named("rewardsCoordinatorAddress", contractAddresses.RewardsCoordinator))
Expand Down

0 comments on commit 857e48c

Please sign in to comment.