sentry icon indicating copy to clipboard operation
sentry copied to clipboard

feat(hybrid-cloud): Add an organization region map table

Open AniketDas-Tekky opened this issue 3 years ago • 4 comments

This table maps an organization to a region key. This region key is then used with SENTRY_REGION_CONFIGS to retrieve region details.

This table is a workaround for an issue that prevents new columns in the Organization table: https://github.com/getsentry/sentry/issues/38821

Once that issue is fixed a new migration should merge this table and the Organizaiton table

AniketDas-Tekky avatar Sep 14 '22 18:09 AniketDas-Tekky

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

--
-- Create model OrganizationRegionMap
--
CREATE TABLE "sentry_organizationregionmap" ("id" bigserial NOT NULL PRIMARY KEY, "region_key" varchar(64) NOT NULL, "organization_id" bigint NOT NULL UNIQUE);
ALTER TABLE "sentry_organizationregionmap" ADD CONSTRAINT "sentry_organizationr_organization_id_5f674544_fk_sentry_or" FOREIGN KEY ("organization_id") REFERENCES "sentry_organization" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_organizationregionmap" VALIDATE CONSTRAINT "sentry_organizationr_organization_id_5f674544_fk_sentry_or";

github-actions[bot] avatar Sep 14 '22 18:09 github-actions[bot]

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

--
-- Create model OrganizationRegionMap
--
CREATE TABLE "sentry_organizationregionmap" ("id" bigserial NOT NULL PRIMARY KEY, "region_key" varchar(64) NOT NULL, "organization_id" bigint NOT NULL UNIQUE);
ALTER TABLE "sentry_organizationregionmap" ADD CONSTRAINT "sentry_organizationr_organization_id_5f674544_fk_sentry_or" FOREIGN KEY ("organization_id") REFERENCES "sentry_organization" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_organizationregionmap" VALIDATE CONSTRAINT "sentry_organizationr_organization_id_5f674544_fk_sentry_or";

github-actions[bot] avatar Sep 14 '22 19:09 github-actions[bot]

I feel like we'd be better off figuring out the specific problem rather than hacking around this with a new table

wedamija avatar Sep 15 '22 17:09 wedamija

I feel like we'd be better off figuring out the specific problem rather than hacking around this with a new table

Agreed, I'm going to fix the problem with the feature flag + migration generation issue, but have been short on time this week :cry:

markstory avatar Sep 16 '22 14:09 markstory

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Oct 08 '22 00:10 github-actions[bot]