use the poll_id column in poll_votes for selecting votes in poll ID

This commit is contained in:
kim 2024-09-16 17:24:34 +01:00
commit 0978b01164

View file

@ -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 {