chore: Remove projecttemplate models pt 1#109890
Conversation
markstory
commented
Mar 4, 2026
- Remove the foreign keys for project template + project template option.
- Move these models to pending deletion.
- Mark the ProjectTemplate and ProjectTemplateOption models as deleted. - Remove the project.template_id field
|
This PR has a migration; here is the generated SQL for for --
-- Alter field organization on projecttemplate
--
SET CONSTRAINTS "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or" IMMEDIATE; ALTER TABLE "sentry_projecttemplate" DROP CONSTRAINT "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or";
ALTER TABLE "sentry_projecttemplate" ALTER COLUMN "organization_id" DROP NOT NULL;
--
-- Alter field project_template on projecttemplateoption
--
SET CONSTRAINTS "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr" IMMEDIATE; ALTER TABLE "sentry_projecttemplateoption" DROP CONSTRAINT "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr";
ALTER TABLE "sentry_projecttemplateoption" ALTER COLUMN "project_template_id" DROP NOT NULL;
--
-- Moved model ProjectTemplateOption to pending deletion state
--
-- (no-op)
--
-- Moved model ProjectTemplate to pending deletion state
--
-- (no-op) |
|
This PR has a migration; here is the generated SQL for for --
-- Alter field organization on projecttemplate
--
SET CONSTRAINTS "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or" IMMEDIATE; ALTER TABLE "sentry_projecttemplate" DROP CONSTRAINT "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or";
ALTER TABLE "sentry_projecttemplate" ALTER COLUMN "organization_id" DROP NOT NULL;
--
-- Alter field project_template on projecttemplateoption
--
SET CONSTRAINTS "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr" IMMEDIATE; ALTER TABLE "sentry_projecttemplateoption" DROP CONSTRAINT "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr";
ALTER TABLE "sentry_projecttemplateoption" ALTER COLUMN "project_template_id" DROP NOT NULL;
--
-- Moved model ProjectTemplateOption to pending deletion state
--
-- (no-op)
--
-- Moved model ProjectTemplate to pending deletion state
--
-- (no-op) |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| from sentry.testutils.silo import control_silo_test | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="fails because projecttemplate was removed") |
There was a problem hiding this comment.
Unrelated migration tests permanently skipped without tracking
Medium Severity
Five completely unrelated migration tests (for email backfill, commit comparison constraints, user deletion, preprod backfill, and uptime assertions) are unconditionally disabled via @pytest.mark.skip. Using unconditional skip instead of skipIf or xfail with a tracked issue means these tests will silently remain disabled indefinitely, losing regression coverage for those features. There's no mechanism to remind anyone to re-enable them once the underlying migration framework issue is resolved.
Additional Locations (2)
|
This PR has a migration; here is the generated SQL for for --
-- Alter field organization on projecttemplate
--
SET CONSTRAINTS "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or" IMMEDIATE; ALTER TABLE "sentry_projecttemplate" DROP CONSTRAINT "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or";
ALTER TABLE "sentry_projecttemplate" ALTER COLUMN "organization_id" DROP NOT NULL;
--
-- Alter field project_template on projecttemplateoption
--
SET CONSTRAINTS "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr" IMMEDIATE; ALTER TABLE "sentry_projecttemplateoption" DROP CONSTRAINT "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr";
ALTER TABLE "sentry_projecttemplateoption" ALTER COLUMN "project_template_id" DROP NOT NULL;
--
-- Moved model ProjectTemplateOption to pending deletion state
--
-- (no-op)
--
-- Moved model ProjectTemplate to pending deletion state
--
-- (no-op) |
71946a7 to
ff0dc10
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Alter field organization on projecttemplate
--
SET CONSTRAINTS "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or" IMMEDIATE; ALTER TABLE "sentry_projecttemplate" DROP CONSTRAINT "sentry_projecttempla_organization_id_b072f5c6_fk_sentry_or";
ALTER TABLE "sentry_projecttemplate" ALTER COLUMN "organization_id" DROP NOT NULL;
--
-- Alter field project_template on projecttemplateoption
--
SET CONSTRAINTS "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr" IMMEDIATE; ALTER TABLE "sentry_projecttemplateoption" DROP CONSTRAINT "sentry_projecttempla_project_template_id_23fa7e71_fk_sentry_pr";
ALTER TABLE "sentry_projecttemplateoption" ALTER COLUMN "project_template_id" DROP NOT NULL;
--
-- Moved model ProjectTemplateOption to pending deletion state
--
-- (no-op)
--
-- Moved model ProjectTemplate to pending deletion state
--
-- (no-op) |

