Validate partition_id NOT NULL on vulnerability_occurrences

What does this MR do and why?

The NOT NULL check constraint on vulnerability_occurrences.partition_id (check_3225d02bda) was previously added as NOT VALID. This MR adds a post-deployment migration that synchronously validates the constraint, so it is enforced for all existing rows. This is the standard second phase of the add-then-validate pattern for NOT NULL constraints on large tables.

Migration output

== 20260629091154 ValidateVulnerabilityOccurrencesPartitionIdNotNull: migrating
-- execute("ALTER TABLE vulnerability_occurrences VALIDATE CONSTRAINT check_3225d02bda;")
== 20260629091154 ValidateVulnerabilityOccurrencesPartitionIdNotNull: migrated

Constraint status on thin clone

    "check_3225d02bda" CHECK (partition_id IS NOT NULL)

References

References #596858 (closed)

Edited by Michał Zając

Merge request reports

Loading
Loading