Skip to content

Drop unused reports table and leftovers - #1767

Merged
SachaProbo merged 1 commit into
mainfrom
SachaProbo/drop-unused-reports-table
Aug 28, 2026
Merged

Drop unused reports table and leftovers#1767
SachaProbo merged 1 commit into
mainfrom
SachaProbo/drop-unused-reports-table

Conversation

@SachaProbo

@SachaProbo SachaProbo commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Audit PDFs already live in files via report_file_id. The reports table and leftover report_id foreign keys were never dropped after that migration.


Summary by cubic

Removes the unused reports domain by dropping the reports table and all report_id references. This consolidates audit PDFs on report_file_id and removes dead code; callers can no longer query by report_id.

Coredata +41 -116

  • Adds a migration that drops cp_document_accesses.report_id, tightens its CHECK to require exactly one of document_id, report_file_id, or compliance_portal_file_id, drops audits.report_id, and drops the reports table.
  • Removes Audits.LoadByReportIDs and the ReportOrderField type.
  • Migration action: run the migration; update any remaining report_id queries to use report_file_id.

Written for commit c213349. Summary will update on new commits.

Review in cubic

@SachaProbo
SachaProbo force-pushed the SachaProbo/drop-unused-reports-table branch from 3810804 to 7582800 Compare August 24, 2026 14:15
@SachaProbo
SachaProbo requested a review from a team August 24, 2026 16:15

@gearnode gearnode 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.

LGTM

@SachaProbo
SachaProbo force-pushed the SachaProbo/drop-unused-reports-table branch from 7582800 to 034b598 Compare August 28, 2026 15:07

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 3 files

Re-trigger cubic

Audit PDFs already live in files via report_file_id.
The reports table and leftover report_id foreign keys
were never dropped after that migration.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
@SachaProbo
SachaProbo force-pushed the SachaProbo/drop-unused-reports-table branch from 034b598 to c213349 Compare August 28, 2026 16:06
@SachaProbo
SachaProbo merged commit c213349 into main Aug 28, 2026
18 checks passed
@SachaProbo
SachaProbo deleted the SachaProbo/drop-unused-reports-table branch August 28, 2026 16:18
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.

2 participants