Skip to content

chore: delete legacy db relations#1954

Open
mxkaske wants to merge 1 commit intomainfrom
chore/delete-legacy-db-relations
Open

chore: delete legacy db relations#1954
mxkaske wants to merge 1 commit intomainfrom
chore/delete-legacy-db-relations

Conversation

@mxkaske
Copy link
Member

@mxkaske mxkaske commented Mar 8, 2026

removing legacy relations that are not used anymore - leftover from migration.

read blog post status-page-components

@vercel
Copy link

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openstatus-dashboard Ready Ready Preview, Comment Mar 8, 2026 3:26pm
openstatus-status-page Ready Ready Preview, Comment Mar 8, 2026 3:26pm
openstatus-web Ready Ready Preview, Comment Mar 8, 2026 3:26pm

Request Review

@mxkaske
Copy link
Member Author

mxkaske commented Mar 12, 2026

@claude review

@claude
Copy link

claude bot commented Mar 12, 2026

Claude finished @mxkaske's task in 1m 44s —— View job


Code Review

  • Gather context
  • Review schema changes
  • Review migration files
  • Review API/router changes
  • Post findings

This PR cleanly removes three legacy junction tables (monitors_to_pages, status_report_to_monitors, maintenance_to_monitor) that were marked @deprecated and superseded by the pageComponent architecture introduced in migration 0054. The changes are consistent and complete across schema, migration, and application code.

What looks good

  • No dangling references: All symbol removals (monitorsToPages, maintenancesToMonitors, monitorsToStatusReport, MonitorToPage, selectMonitorToPageSchema) are fully cleaned up — no remaining consumers across the codebase.
  • Consistent cleanup: Both delete paths — the RPC service (apps/server/src/routes/rpc/services/monitor/index.ts) and the tRPC router (packages/api/src/router/monitor.ts) — are updated in lockstep.
  • Migration is correct: 0058_absent_chameleon.sql drops all three tables, which matches what was previously described as "will be dropped in future migration after verification period."
  • Commented-out dead code removed: The pagesToStatusReports block commented out in status_reports.ts is also cleaned up — good call.
  • monitorGroup is unaffected: It was only used by monitorsToPages (for monitorGroupId), but the monitorGroup table itself is still valid and used in the pageComponent architecture.

Minor observations

  1. Missing newline at end of SQL filepackages/db/drizzle/0058_absent_chameleon.sql is missing a trailing newline (line 3 has no \n). Minor style inconsistency with other migration files, but functionally harmless.

  2. Irreversible migration — Dropping tables is permanent. The previous @deprecated JSDoc confirmed the data was migrated in 0054 (monitors_to_pages → page_component, etc.), so this is expected and intentional. Worth a sanity check that production data was fully migrated before running this migration.

Verdict

The changes are clean, minimal, and correct. The only concern worth a second look before merging is confirming the data migration in 0054 ran successfully in production. Otherwise this is straightforward dead-code removal — approve when ready.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant