Skip to content

Commit

Permalink
add missing migration's ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Dec 31, 2024
1 parent 7f58038 commit c43c651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/storage/approved_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func NewApprovedUsers(ctx context.Context, db *Engine) (*ApprovedUsers, error) {
}

var exists int
err := db.Get(&exists, "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='approved_users'")
err := db.GetContext(ctx, &exists, "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='approved_users'")
if err != nil {
return nil, fmt.Errorf("failed to check for approved_users table existence: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion app/storage/detected_spam.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewDetectedSpam(ctx context.Context, db *Engine) (*DetectedSpam, error) {
// first check if the table exists. we can't do this in a transaction
// because missing columns will cause the transaction to fail
var exists int
err := db.Get(&exists, "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='detected_spam'")
err := db.GetContext(ctx, &exists, "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='detected_spam'")
if err != nil {
return nil, fmt.Errorf("failed to check for detected_spam table existence: %w", err)
}
Expand Down

0 comments on commit c43c651

Please sign in to comment.