chore(alerts): Remove metric alert constraint on NotificationMessage#115529
Open
ceorourke wants to merge 3 commits into
Open
chore(alerts): Remove metric alert constraint on NotificationMessage#115529ceorourke wants to merge 3 commits into
ceorourke wants to merge 3 commits into
Conversation
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Remove constraint singular_parent_message_per_incident_and_trigger_action from model notificationmessage
--
DROP INDEX CONCURRENTLY IF EXISTS "singular_parent_message_per_incident_and_trigger_action";
--
-- Remove constraint notifmsg_metric_or_workflow_exclusive from model notificationmessage
--
ALTER TABLE "sentry_notificationmessage" DROP CONSTRAINT "notifmsg_metric_or_workflow_exclusive"; |
wedamija
approved these changes
May 13, 2026
| name="idx_notifmsg_group_action_date", | ||
| ), | ||
| ] | ||
| constraints = [ |
Member
There was a problem hiding this comment.
Do we still need some of these constraints? Or are they all unused now?
Member
Author
There was a problem hiding this comment.
I'll be removing incident and trigger action so the only constraint we might want is that both action and group are set but I intend to enforce that by removing the nullability on them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now that we've cleaned up usage we are no longer using the metric alert columns on this model and are exclusively writing to
actionandgroupfor workflow engine notifications. Remove the constraints for metric alert notification messages so that we can remove theincidentandtrigger_actioncolumns in follow ups. This is slightly risky in that technically without the constraint someone could write incorrect fields, but I'll be doing these migrations one after the other so the risk is minimal. I am planning to makeactionandgroupboth not nullable.