feat(store): purge old notifications, invitations, tokens and incidents

Refs #63

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 09:50:12 +01:00
1 parent 97229b91d1
commit 057e41d5b6
3 files changed
+80

No files matched your search

+6
View File
@@ -151,6 +151,12 @@ type Querier interface {
OpenIncident(ctx context.Context, arg OpenIncidentParams) (Incident, error)
OpenIncidents(ctx context.Context) ([]Incident, error)
OrgIDBySlug(ctx context.Context, slug string) (uuid.UUID, error)
PurgeExpiredTokens(ctx context.Context, expiresAt *time.Time) (int64, error)
// Incidents resolved before the oldest data still charted.
PurgeIncidents(ctx context.Context, resolvedAt *time.Time) (int64, error)
PurgeInvitations(ctx context.Context, expiresAt time.Time) (int64, error)
// Delivered and given-up notifications; pending ones are still being worked.
PurgeNotifications(ctx context.Context, createdAt time.Time) (int64, error)
// Raw results bucketed by width since a point in time, for short ranges.
RangeBuckets(ctx context.Context, arg RangeBucketsParams) ([]RangeBucketsRow, error)
// The daily aggregate rebucketed by width, for ranges of months.