Manual refactor

This commit is contained in:
binwiederhier
2026-02-22 14:25:15 -05:00
parent 5d301e7dce
commit f726cc768e
3 changed files with 6 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ const (
FROM webpush_subscription
WHERE warned_at = 0 AND updated_at <= $1
`
postgresInsertSubscriptionQuery = `
postgresUpsertSubscriptionQuery = `
INSERT INTO webpush_subscription (id, endpoint, key_auth, key_p256dh, user_id, subscriber_ip, updated_at, warned_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
ON CONFLICT (endpoint)
@@ -80,7 +80,7 @@ func NewPostgresStore(db *sql.DB) (Store, error) {
selectSubscriptionCountBySubscriberIP: postgresSelectSubscriptionCountBySubscriberIPQuery,
selectSubscriptionsForTopic: postgresSelectSubscriptionsForTopicQuery,
selectSubscriptionsExpiringSoon: postgresSelectSubscriptionsExpiringSoonQuery,
insertSubscription: postgresInsertSubscriptionQuery,
upsertSubscription: postgresUpsertSubscriptionQuery,
updateSubscriptionWarningSent: postgresUpdateSubscriptionWarningSentQuery,
updateSubscriptionUpdatedAt: postgresUpdateSubscriptionUpdatedAtQuery,
deleteSubscriptionByEndpoint: postgresDeleteSubscriptionByEndpointQuery,