-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat(team-workflow): Add team to GroupSubscription #55879
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
don't merge until ops has run the migration |
Codecov Report
@@ Coverage Diff @@
## master #55879 +/- ##
==========================================
- Coverage 79.98% 78.05% -1.94%
==========================================
Files 5061 5063 +2
Lines 217762 217846 +84
Branches 36869 36879 +10
==========================================
- Hits 174176 170032 -4144
- Misses 38238 42521 +4283
+ Partials 5348 5293 -55
|
This comment was marked as outdated.
This comment was marked as outdated.
This PR has a migration; here is the generated SQL for --
-- Add field team to groupsubscription
--
ALTER TABLE "sentry_groupsubscription" ADD COLUMN "team_id" bigint NULL;
--
-- Custom state/database change combination
--
ALTER TABLE "sentry_groupsubscription" ALTER COLUMN "user_id" DROP NOT NULL;
;
--
-- Alter unique_together for groupsubscription (2 constraint(s))
--
CREATE UNIQUE INDEX CONCURRENTLY "sentry_groupsubscription_group_id_team_id_ba7c937c_uniq" ON "sentry_groupsubscription" ("group_id", "team_id");
ALTER TABLE "sentry_groupsubscription" ADD CONSTRAINT "sentry_groupsubscription_group_id_team_id_ba7c937c_uniq" UNIQUE USING INDEX "sentry_groupsubscription_group_id_team_id_ba7c937c_uniq";
ALTER TABLE "sentry_groupsubscription" ADD CONSTRAINT "sentry_groupsubscription_team_id_255af5da_fk_sentry_team_id" FOREIGN KEY ("team_id") REFERENCES "sentry_team" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_groupsubscription" VALIDATE CONSTRAINT "sentry_groupsubscription_team_id_255af5da_fk_sentry_team_id";
CREATE INDEX CONCURRENTLY "sentry_groupsubscription_team_id_255af5da" ON "sentry_groupsubscription" ("team_id");
--
-- Create constraint subscription_team_or_user_check on model groupsubscription
--
ALTER TABLE "sentry_groupsubscription" ADD CONSTRAINT "subscription_team_or_user_check" CHECK ((("team_id" IS NOT NULL AND "user_id" IS NULL) OR ("team_id" IS NULL AND "user_id" IS NOT NULL))) NOT VALID;
ALTER TABLE "sentry_groupsubscription" VALIDATE CONSTRAINT "subscription_team_or_user_check"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration looks good to me. We'll need to wait for schema changes to be applied in saas before merging this though.
This PR has a migration; here is the generated SQL for --
-- Add field team to groupsubscription
--
ALTER TABLE "sentry_groupsubscription" ADD COLUMN "team_id" bigint NULL;
--
-- Custom state/database change combination
--
ALTER TABLE "sentry_groupsubscription" ALTER COLUMN "user_id" DROP NOT NULL;
;
--
-- Alter unique_together for groupsubscription (2 constraint(s))
--
CREATE UNIQUE INDEX CONCURRENTLY "sentry_groupsubscription_group_id_team_id_ba7c937c_uniq" ON "sentry_groupsubscription" ("group_id", "team_id");
ALTER TABLE "sentry_groupsubscription" ADD CONSTRAINT "sentry_groupsubscription_group_id_team_id_ba7c937c_uniq" UNIQUE USING INDEX "sentry_groupsubscription_group_id_team_id_ba7c937c_uniq";
ALTER TABLE "sentry_groupsubscription" ADD CONSTRAINT "sentry_groupsubscription_team_id_255af5da_fk_sentry_team_id" FOREIGN KEY ("team_id") REFERENCES "sentry_team" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_groupsubscription" VALIDATE CONSTRAINT "sentry_groupsubscription_team_id_255af5da_fk_sentry_team_id";
CREATE INDEX CONCURRENTLY "sentry_groupsubscription_team_id_255af5da" ON "sentry_groupsubscription" ("team_id");
--
-- Create constraint subscription_team_or_user_check on model groupsubscription
--
ALTER TABLE "sentry_groupsubscription" ADD CONSTRAINT "subscription_team_or_user_check" CHECK ((("team_id" IS NOT NULL AND "user_id" IS NULL) OR ("team_id" IS NULL AND "user_id" IS NOT NULL))) NOT VALID;
ALTER TABLE "sentry_groupsubscription" VALIDATE CONSTRAINT "subscription_team_or_user_check"; |
this pr adds back the addition of team as a field on GroupSubscription (originally from #55805 , removed in #55870) .