feat(hybrid-cloud): Add an organization region map table
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
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";
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";
I feel like we'd be better off figuring out the specific problem rather than hacking around this with a new table
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:
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 🥀