Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete game comments when annotated game is deleted #1188

Merged
merged 2 commits into from
Aug 12, 2023

Conversation

jonager
Copy link
Collaborator

@jonager jonager commented Aug 11, 2023

closes #1166

tx, err := s.dbPool.BeginTx(ctx, common.DefaultTxOptions)
if err != nil {
return err
}
defer tx.Rollback(ctx)
err = s.dbPool.QueryRow(ctx, `SELECT id FROM games WHERE uuid = $1`, uuid).Scan(&gameID)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be in the same tx?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, good catch

@jonager jonager requested a review from andy-k August 11, 2023 01:49
@domino14 domino14 merged commit 445098c into master Aug 12, 2023
2 checks passed
@domino14 domino14 deleted the 1166-cannot-delete-annoted-games-with-comments branch August 12, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deleting an annotated game that has comments is not allowed
3 participants