Skip to content

ref(dashboards): Remove DashboardLastVisited model#114929

Open
wedamija wants to merge 1 commit intomasterfrom
flag-cleanup/remove-dashboard-last-visited-model
Open

ref(dashboards): Remove DashboardLastVisited model#114929
wedamija wants to merge 1 commit intomasterfrom
flag-cleanup/remove-dashboard-last-visited-model

Conversation

@wedamija
Copy link
Copy Markdown
Member

@wedamija wedamija commented May 5, 2026

The DashboardLastVisited model was added to back per-user "recently viewed" sorting and per-user last_visited reads gated on organizations:dashboards-starred-reordering. That flag was removed (#114817), the writes were removed in the same PR's follow-up, so the model has no remaining readers or writers in product code.

This PR removes the model class, all code references (testutils backups, backup comparators), and adds a MOVE_TO_PENDING migration that drops the FK constraints and removes the model from Django's migration state. The table is preserved for rolling deploy safety; a follow-up PR drops it.

The DashboardLastVisited model was added to back per-user
"recently viewed" sorting and per-user last_visited reads gated on
organizations:dashboards-starred-reordering. That flag was removed
(#114817), the writes were removed in the same PR's follow-up, so the
model has no remaining readers or writers in product code.

This PR removes the model class, all code references (testutils backups,
backup comparators), and adds a MOVE_TO_PENDING migration that drops the
FK constraints and removes the model from Django's migration state. The
table is preserved for rolling deploy safety; a follow-up PR drops it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wedamija wedamija requested a review from narsaynorath May 5, 2026 23:12
@wedamija wedamija requested review from a team as code owners May 5, 2026 23:12
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

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

for 1081_remove_dashboardlastvisited in sentry

--
-- Alter field dashboard on dashboardlastvisited
--
SET CONSTRAINTS "sentry_dashboardlast_dashboard_id_31d3a51b_fk_sentry_da" IMMEDIATE; ALTER TABLE "sentry_dashboardlastvisited" DROP CONSTRAINT "sentry_dashboardlast_dashboard_id_31d3a51b_fk_sentry_da";
--
-- Alter field member on dashboardlastvisited
--
SET CONSTRAINTS "sentry_dashboardlast_member_id_28801a0a_fk_sentry_or" IMMEDIATE; ALTER TABLE "sentry_dashboardlastvisited" DROP CONSTRAINT "sentry_dashboardlast_member_id_28801a0a_fk_sentry_or";
--
-- Moved model DashboardLastVisited to pending deletion state
--
-- (no-op)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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