From 0978b011647ad5f1d05a61eb0582439e9a7f9ddb Mon Sep 17 00:00:00 2001 From: kim Date: Mon, 16 Sep 2024 17:24:34 +0100 Subject: [PATCH] use the poll_id column in poll_votes for selecting votes in poll ID --- internal/db/bundb/poll.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/db/bundb/poll.go b/internal/db/bundb/poll.go index 7552f0ded..f5c33ce9b 100644 --- a/internal/db/bundb/poll.go +++ b/internal/db/bundb/poll.go @@ -191,7 +191,7 @@ func (p *pollDB) DeletePollByID(ctx context.Context, id string) error { // Delete the poll votes. _, err := tx.NewDelete(). Table("poll_votes"). - Where("? = ?", bun.Ident("id"), id). + Where("? = ?", bun.Ident("poll_id"), id). Exec(ctx) return err }); err != nil {