Skip to content

Draft: Ignore Vulnerabilities::Occurrence#uuid column

What does this MR do?

As per #212322 (closed) the uuid column is unused and should be dropped. This is the first MR as outlined in #212322 (comment 366879511)

rails db:migrate

Migration execution
== 20200916172616 DropNotNullConstraintOnVulnerabilitiesOccurrencesUuid: migrating 
-- execute("ALTER TABLE vulnerability_occurrences ALTER COLUMN uuid DROP NOT NULL\n")
   -> 0.0094s
== 20200916172616 DropNotNullConstraintOnVulnerabilitiesOccurrencesUuid: migrated (0.0095s) 

rails db:rollback

I tried using add_not_null_constraint(:vulnerability_occurrences, :uuid, validate: false) in the rollback method but it often left me with a change in structure.sql with both NOT NULL and a ADD CONSTRAINT declaration

Migration execution
== 20200916172616 DropNotNullConstraintOnVulnerabilitiesOccurrencesUuid: reverting 
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE vulnerability_occurrences\nADD CONSTRAINT check_da63862fbe\nCHECK ( uuid IS NOT NULL )\nNOT VALID;\n")
   -> 0.0021s
== 20200916172616 DropNotNullConstraintOnVulnerabilitiesOccurrencesUuid: reverted (0.1133s)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Michał Zając

Merge request reports