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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by Michał Zając