Skip to content

Ensure only valid columns are listed in sharding_key_spec.rb

What does this MR do and why?

This MR cleans up the schema_spec.rb file by removing references to columns that no longer exist in the database schema. It also adds a test to ensure that no invalid values are accepted in the future. The changes ensure that the spec only validates foreign keys for columns that are actually present in the tables.

Changes made:

  1. Added validation to ensure ignored columns actually exist in the table schema before attempting to validate foreign keys
  2. Removed obsolete column references from the removed_fks_map and ignored_fks_map:
    • alert_management_alerts.prometheus_alert_id
    • analytics_cycle_analytics_aggregations.last_full_run_issues_id and last_full_run_merge_requests_id
    • broadcast_messages.namespace_id
    • compliance_management_frameworks.group_id
    • notes.confirmed_by_id
    • projects.ci_id
    • backup_vulnerabilities.vulnerability_id
    • vulnerability_reads.namespace_id
    • webauthn_registrations.u2f_registration_id
    • zoekt_repositories.namespace_id

References

Related to #547650 (closed)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Pedro Pombeiro

Merge request reports

Loading