[Database] DB schema and migrations to support filtering of vulnerabilities by identifier
As per the requirement and the MVC scope discussed in #432419 (closed) we need to have identifiers stored in vulnerabilitiy_reads
table to support filtering of vulnerabilities by identifiers on the vulnerability report page.
In this issue we track the DB related work to implement the feature.
Implementation details
Abandoned old plan:
Reason: #460080 (comment 2007295428)
-
backend database
Include identifiers column of array text type invulnerability_reads
. -
backend database
Ingest new vulnerability identifiers into the array column invulnerability_reads
. -
backend database
Data backfill migration to populate the already existing identifiers tovulnerability_reads
.
New plan:
With the requirement to use identifier.name
in the vulnerability_reads array column the revised implementation looks like:
- backend database Abandon the already running databackfill migration from the old implementation plan above. Process around this is available in !160594 (merged)
-
backend database Disable the existing ingestion logic and ignore the old column
identifier_external_ids
. Process to follow https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#dropping-columns -
backend database Include new
identifier_names
column of array text type invulnerability_reads
. Renaming older column is not possible as the old column has a default value[]
. See: link. -
backend database Revise Ingestion logic to populate
identifiers.name
into the array column invulnerability_reads.identifier_names
. -
backend database Data backfill migration (BBM) to populate the already existing identifiers to
vulnerability_reads
on the newidentifier_names
column.
Edited by Bala Kumar