Skip to content

chore(alerts): Add index on date_added, soft remove metric alert colu…#115823

Merged
ceorourke merged 3 commits into
masterfrom
ceorourke/pending-delete-metric-alert-cols-notifmsg
May 20, 2026
Merged

chore(alerts): Add index on date_added, soft remove metric alert colu…#115823
ceorourke merged 3 commits into
masterfrom
ceorourke/pending-delete-metric-alert-cols-notifmsg

Conversation

@ceorourke
Copy link
Copy Markdown
Member

Follow up to #115578 to start removal of the metric alert columns and add an index on date_added to prep for adding a cleanup job on the table for rows over 90 days old.

@ceorourke ceorourke requested review from a team as code owners May 19, 2026 17:19
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/notifications/migrations/0011_pending_delete_metric_alert_cols_notifmsg.py

for 0011_pending_delete_metric_alert_cols_notifmsg in notifications

--
-- Moved notificationmessage.incident field to pending deletion state
--
-- (no-op)
--
-- Moved notificationmessage.trigger_action field to pending deletion state
--
-- (no-op)
--
-- Create index sentry_noti_date_ad_ac82c5_idx on field(s) date_added of model notificationmessage
--
CREATE INDEX CONCURRENTLY "sentry_noti_date_ad_ac82c5_idx" ON "sentry_notificationmessage" ("date_added");

Copy link
Copy Markdown
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.

lgtm, this will need to be post deploy though since the index will take a while.

The soft removals are a no-op so it'll be fine to have them run as part of the post deploy

@ceorourke ceorourke requested a review from a team as a code owner May 19, 2026 20:10
@ceorourke ceorourke merged commit 2b86e3c into master May 20, 2026
83 of 84 checks passed
@ceorourke ceorourke deleted the ceorourke/pending-delete-metric-alert-cols-notifmsg branch May 20, 2026 22:12
ceorourke added a commit that referenced this pull request May 21, 2026
…ge (#116025)

Follow up to #115823 to fully
remove the metric alert columns. The previous migration has been
applied.
JonasBa pushed a commit that referenced this pull request May 21, 2026
#115823)

Follow up to #115578 to start
removal of the metric alert columns and add an index on `date_added` to
prep for adding a cleanup job on the table for rows over 90 days old.
natemoo-re pushed a commit that referenced this pull request May 21, 2026
…ge (#116025)

Follow up to #115823 to fully
remove the metric alert columns. The previous migration has been
applied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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