ref(dynamic-sampling): Drop CustomDynamicSamplingRule tables#112453
Open
ref(dynamic-sampling): Drop CustomDynamicSamplingRule tables#112453
Conversation
Step 2 of the table deletion process: physically drop the sentry_customdynamicsamplingrule and sentry_customdynamicsamplingruleproject tables from PostgreSQL. The previous migration (1063) already removed foreign key constraints and moved the models to pending deletion state. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Missing historical_silo_assignments prevents table drops from executing
- Added sentry_customdynamicsamplingrule and sentry_customdynamicsamplingruleproject to historical_silo_assignments in router.py with SiloMode.CELL so the SafeDeleteModel DELETE operations can resolve the database and execute DROP TABLE.
- ✅ Fixed: Lockfile not updated for new migration head
- Updated migrations_lockfile.txt to point to 1065_delete_customdynamicsamplingrule as the new sentry migration head.
Or push these changes by commenting:
@cursor push a55b9dce76
Preview (a55b9dce76)
diff --git a/migrations_lockfile.txt b/migrations_lockfile.txt
--- a/migrations_lockfile.txt
+++ b/migrations_lockfile.txt
@@ -31,7 +31,7 @@
seer: 0005_delete_seerorganizationsettings
-sentry: 1064_eventattachment_date_expires_now
+sentry: 1065_delete_customdynamicsamplingrule
social_auth: 0003_social_auth_json_field
diff --git a/src/sentry/db/router.py b/src/sentry/db/router.py
--- a/src/sentry/db/router.py
+++ b/src/sentry/db/router.py
@@ -89,6 +89,8 @@
"sentry_projecttemplate": SiloMode.CELL,
"sentry_projecttemplateoption": SiloMode.CELL,
"uptime_projectuptimesubscription": SiloMode.CELL,
+ "sentry_customdynamicsamplingrule": SiloMode.CELL,
+ "sentry_customdynamicsamplingruleproject": SiloMode.CELL,
"workflow_engine_actiongroupstatus": SiloMode.CELL,
"workflow_engine_workflowaction": SiloMode.CELL,
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 79f00d3. Configure here.
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Delete model CustomDynamicSamplingRuleProject
--
DROP TABLE "sentry_customdynamicsamplingruleproject" CASCADE;
--
-- Delete model CustomDynamicSamplingRule
--
DROP TABLE "sentry_customdynamicsamplingrule" CASCADE; |
…plingRule Add sentry_customdynamicsamplingrule and sentry_customdynamicsamplingruleproject to historical_silo_assignments so that the deletion migration can resolve the correct database in test environments. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
vgrozdanic
approved these changes
Apr 8, 2026
wedamija
approved these changes
Apr 8, 2026
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.


Step 2 of the table deletion process: physically drop the sentry_customdynamicsamplingrule and sentry_customdynamicsamplingruleproject tables from PostgreSQL.
The previous migration (1063) already removed foreign key constraints and moved the models to pending deletion state.
Closes TET-1957