Skip to content

Drop snapshot schema#1166

Open
SachaProbo wants to merge 1 commit into
SachaProbo/remove-snapshotsfrom
SachaProbo/drop-snapshot-schema
Open

Drop snapshot schema#1166
SachaProbo wants to merge 1 commit into
SachaProbo/remove-snapshotsfrom
SachaProbo/drop-snapshot-schema

Conversation

@SachaProbo
Copy link
Copy Markdown
Contributor

@SachaProbo SachaProbo commented May 7, 2026

Drops the now-unused snapshot_id/source_id columns from every table that carried them, the snapshots and controls_snapshots tables, the snapshots_type enum, and the snapshot-scoped indexes. Recreates the unique indexes that previously gated on snapshot_id IS NULL without the snapshot scope. The data was already cleaned up in the prior PR.


Summary by cubic

Drop the snapshot schema and scope across the DB, and update error handling to match the new unique index names. Removes all snapshot_id/source_id columns, deletes snapshot tables/enum, and recreates unique indexes without snapshot gating.

  • Migration

    • Drop snapshot_id/source_id across affected tables; remove snapshot-scoped indexes (states_of_applicability_source_id_snapshot_id_uniq, states_of_applicability_name_organization_id_uniq, idx_findings_organization_snapshot, etc.); drop snapshots, controls_snapshots, and snapshots_type.
    • Recreate unique indexes without snapshot scope:
      • statements_of_applicability_name_organization_id_uniq
      • idx_findings_org_reference_id
      • processing_activity_dpias_processing_activity_id_uniq
      • processing_activity_tias_processing_activity_id_uniq
  • Refactors

    • Update constraint-name checks in pkg/coredata/data_protection_impact_assessment.go and pkg/coredata/transfer_impact_assessment.go to the new unique index names.

Written for commit 89032df. Summary will update on new commits.

@SachaProbo SachaProbo force-pushed the SachaProbo/remove-snapshots branch from 1182c67 to 0ffe994 Compare May 7, 2026 15:24
@SachaProbo SachaProbo force-pushed the SachaProbo/drop-snapshot-schema branch from cb7e4bb to cc6b38e Compare May 7, 2026 15:24
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

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

@SachaProbo SachaProbo force-pushed the SachaProbo/remove-snapshots branch from 0ffe994 to 95c4923 Compare May 7, 2026 15:26
Drops the now-unused snapshot_id/source_id columns from every table that
carried them, the snapshots and controls_snapshots tables, the
snapshots_type enum, and the snapshot-scoped indexes. Recreates the
unique indexes that previously gated on snapshot_id IS NULL without the
snapshot scope. The data was already cleaned up in the prior PR.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
@SachaProbo SachaProbo requested a review from a team May 7, 2026 15:26
@SachaProbo SachaProbo force-pushed the SachaProbo/drop-snapshot-schema branch from cc6b38e to 89032df Compare May 7, 2026 15:26
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