Skip to content

ref(uptime): Make subscription unique on timeout as well #78787

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

Conversation

evanpurkhiser
Copy link
Member

The timeout will become configurable, so we need subscriptions to be
unique on this additional facet.

The timeout will become configurable, so we need subscriptions to be
unique on this additional facet.
@evanpurkhiser evanpurkhiser requested a review from a team as a code owner October 8, 2024 19:39
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

This PR has a migration; here is the generated SQL for src/sentry/uptime/migrations/0017_unique_on_timeout.py ()

--
-- Remove constraint uptime_uptimesubscription_unique_subscription_check from model uptimesubscription
--
DROP INDEX CONCURRENTLY IF EXISTS "uptime_uptimesubscription_unique_subscription_check";
--
-- Create constraint uptime_uptimesubscription_unique_subscription_check on model uptimesubscription
--
CREATE UNIQUE INDEX CONCURRENTLY "uptime_uptimesubscription_unique_subscription_check" ON "uptime_uptimesubscription" ("url", "interval_seconds", "timeout_ms", "method", (MD5("headers")), (COALESCE(MD5("body"), '')));

Copy link
Member

@wedamija wedamija left a comment

Choose a reason for hiding this comment

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

The table should be small enough that we can run this with the deploy

@evanpurkhiser evanpurkhiser merged commit 137448c into master Oct 9, 2024
51 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-uptime-make-subscription-unique-on-timeout-as-well branch October 9, 2024 17:15
cmanallen pushed a commit that referenced this pull request Oct 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants