Skip to content

Commit

Permalink
fix: remove constraint reference
Browse files Browse the repository at this point in the history
  • Loading branch information
clockworkgr committed Mar 6, 2024
1 parent 4af9a89 commit 30b9b57
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions database/gov.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,7 @@ WHERE proposal_deposit.height <= excluded.height`
func (db *Db) SaveVote(vote types.Vote) error {
query := `
INSERT INTO proposal_vote (proposal_id, voter_address, option, timestamp, height)
VALUES ($1, $2, $3, $4, $5)
ON CONFLICT ON CONSTRAINT unique_vote DO UPDATE
SET option = excluded.option,
timestamp = excluded.timestamp,
height = excluded.height
WHERE proposal_vote.height <= excluded.height`
VALUES ($1, $2, $3, $4, $5)`

// Store the voter account
err := db.SaveAccounts([]types.Account{types.NewAccount(vote.Voter)})
Expand Down

0 comments on commit 30b9b57

Please sign in to comment.