You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: poll.go
    path of file: ./repos/gotosocial/internal/db/bundb
    
    the code of the file until where you have to start completion: // GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

package bundb

import (
	"context"
	"errors"
	"slices"
	"time"

	"github.com/superseriousbusiness/gotosocial/internal/db"
	"github.com/superseriousbusiness/gotosocial/internal/gtscontext"
	"github.com/superseriousbusiness/gotosocial/internal/gtserror"
	"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
	"githu
    
func (p *pollDB) DeletePollVotes(ctx context.Context, pollID string) error {
	err := p.db.RunInTx(ctx, nil, func(ctx context.Context, tx bun.Tx) error {
		// Delete all votes in poll.
		res, err := tx.NewDelete().
			Table("poll_votes").
			Where("? = ?", bun.Ident("poll_id"), pollID).
			Exec(ctx)
		if err != nil {
			// irrecoverable
			return err
		}

		ra, err := res.RowsAffected()
		if err != nil {
			// irrecoverable
			return err
		}

		if ra == 0 {
			// No poll votes deleted,
			// nothing to update.
			return nil
		}

		// Select current poll counts from DB,
		// taking minimal columns needed to
		// increment/decrement votes.
		var poll gtsmodel.Poll
		switch err := tx.NewSelect().
			Model(&poll).
			Column("options", "votes", "voters").
			Where("? = ?", bun.Ident("id"), pollID).
			Scan(ctx); {

		case err == nil:
			// no issue.

		case errors.Is(err, db.ErrNoEntries):
			// no votes found,
			// return here.
			return nil

		default:
			// irrecoverable.
			return err
		}

		// Zero all counts.
		poll.ResetVotes()

		// Finally, update the poll entry.
		_, err = tx.NewUpdate().
			Model(&poll).
			Column("votes", "voters").
			Where("? = ?", bun.Ident("id"), pollID).
			Exec(ctx)
		return err
	})

	if err != nil {
		return err
	}

	// Invalidate poll vote and poll entry from caches.
	p.state.Caches.GTS.Poll.Invalidate("ID", pollID)
	p.state.Caches.GTS.PollVote.Invalidate("PollID", pollID)
	p.state.Caches.GTS.PollVoteIDs.Invalidate(pollID)

	return nil
}