Skip to content

Commit 6e9a200

Browse files
committed
fix(db): update UpsertAlert to use explicit Find→Create/Save
1 parent 4c1b2cd commit 6e9a200

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/db/repository_analytics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func (r *analyticsRepo) GetSnapshotHistory(ctx context.Context, repoID uint, sin
259259
// UpsertAlert creates or updates a security alert
260260
// Matches by repository_id, alert_type, and alert_number
261261
func (r *analyticsRepo) UpsertAlert(ctx context.Context, alert *SecurityAlert) error {
262-
// NOTE: FirstOrCreate+Assign does not reliably update existing records in GORM v2
262+
// FirstOrCreate+Assign does not reliably update existing records in GORM v2
263263
// (Assign only assigns on create in some versions). Use explicit Find→Create/Save instead.
264264
var existing SecurityAlert
265265
err := r.db.WithContext(ctx).

0 commit comments

Comments
 (0)