Skip to content

ref(dashboards): Drop DashboardTombstone table#114267

Merged
gggritso merged 5 commits into
masterfrom
georgegritsouk/dain-1567-delete-dashboardtombstone
Apr 30, 2026
Merged

ref(dashboards): Drop DashboardTombstone table#114267
gggritso merged 5 commits into
masterfrom
georgegritsouk/dain-1567-delete-dashboardtombstone

Conversation

@gggritso

@gggritso gggritso commented Apr 29, 2026

Copy link
Copy Markdown
Member

Drop the sentry_dashboardtombstone table from PostgreSQL via
SafeDeleteModel(DELETE).

Do not merge this until #114265 has been deployed and verified in production.

PR Stack

  1. ref(dashboards): Remove DashboardTombstone model #114265 — Remove model + MOVE_TO_PENDING migration
  2. ref(dashboards): Drop DashboardTombstone table #114267 ← this PRDELETE migration to drop the table (deploy after ref(dashboards): Remove DashboardTombstone model #114265)

Refs DAIN-1567

@linear-code

linear-code Bot commented Apr 29, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1074_remove_dashboardtombstone.py src/sentry/migrations/1075_delete_dashboardtombstone.py

for 1074_remove_dashboardtombstone in sentry

--
-- Alter field organization on dashboardtombstone
--
SET CONSTRAINTS "sentry_dashboardtomb_organization_id_fa5fbf63_fk_sentry_or" IMMEDIATE; ALTER TABLE "sentry_dashboardtombstone" DROP CONSTRAINT "sentry_dashboardtomb_organization_id_fa5fbf63_fk_sentry_or";
--
-- Moved model DashboardTombstone to pending deletion state
--
-- (no-op)

for 1075_delete_dashboardtombstone in sentry

--
-- Delete model DashboardTombstone
--
DROP TABLE "sentry_dashboardtombstone" CASCADE;

@gggritso gggritso changed the base branch from georgegritsouk/dain-1567-move-to-pending-dashboardtombstone to georgegritsouk/dain-1567-remove-dashboardtombstone-model April 29, 2026 14:30

@wedamija wedamija left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly lgtm, but you'll need to fix this test failure to make sure the table is really deleted

ValueError: Cannot determine database for deleted model sentry.DashboardTombstone (table: sentry_dashboardtombstone). This table must be added to historical_silo_assignments in src/sentry/db/router.py (or getsentry/db/router.py for getsentry models) with the appropriate SiloMode before the deletion migration can run.

Base automatically changed from georgegritsouk/dain-1567-remove-dashboardtombstone-model to master April 29, 2026 17:46

@wedamija wedamija left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration 1075 lgtm, just need to rebase and clean up

gggritso and others added 2 commits April 29, 2026 14:42
Delete the sentry_dashboardtombstone table from PostgreSQL. The model
was moved to pending deletion in the previous migration.

Refs DAIN-1567
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The DELETE migration needs to know which database the table lives on.
Since the model class is already removed, the router falls back to
historical_silo_assignments to resolve silo mode.

Refs DAIN-1567
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gggritso gggritso force-pushed the georgegritsouk/dain-1567-delete-dashboardtombstone branch from 34cefd9 to abc212f Compare April 29, 2026 18:42
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1075_delete_dashboardtombstone.py

for 1075_delete_dashboardtombstone in sentry

--
-- Delete model DashboardTombstone
--
DROP TABLE "sentry_dashboardtombstone" CASCADE;

@gggritso gggritso marked this pull request as ready for review April 29, 2026 19:02
@gggritso gggritso requested a review from a team as a code owner April 29, 2026 19:02

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0137160. Configure here.

Comment thread src/sentry/migrations/1076_delete_dashboardtombstone.py
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1076_delete_dashboardtombstone.py

for 1076_delete_dashboardtombstone in sentry

--
-- Delete model DashboardTombstone
--
DROP TABLE "sentry_dashboardtombstone" CASCADE;

@gggritso gggritso merged commit 0c279aa into master Apr 30, 2026
81 checks passed
@gggritso gggritso deleted the georgegritsouk/dain-1567-delete-dashboardtombstone branch April 30, 2026 14:51
cleptric pushed a commit that referenced this pull request May 5, 2026
Drop the `sentry_dashboardtombstone` table from PostgreSQL via
`SafeDeleteModel(DELETE)`.

Do not merge this until #114265 has been deployed and verified in
production.

## PR Stack
1. #114265 — Remove model + `MOVE_TO_PENDING` migration
2. **#114267 ← this PR** — `DELETE` migration to drop the table (deploy
after #114265)

Refs DAIN-1567

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot locked and limited conversation to collaborators May 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants