Remove unused unique indexes related to SBOM tables
Why are we doing this work?
Per backwards compatibility docs, migrations run before new code gets deployed. This means that any schema migrations we make need to be compatible with the old code.
For this reason, while creating new unique indexes to sbom_ tables with the new column organization_id,
in some cases we did not remove the old unique index (i.e. the one w/o organization_id).
These old unique indexes need to be removed.
See (size: L) Govern: Threat Insights - Cells Support (&13087 - closed)
Further details
The following MRs introduced new unique DB indexes that include the organization_id column,
used as a sharding key.
These new DB indexes are normal DB migrations, and they're part of 17.3.
17.3 is an upgrade stop.
Implementation plan
-
Drop idx_sbom_source_packages_on_name_and_purl_type, replaced byindex_sbom_source_packages_on_name_and_purl_type_and_org_id. -
Drop index_sbom_components_on_component_type_name_and_purl_type, replaced byidx_sbom_components_on_name_purl_type_component_type_and_org_id. -
DropSee #469435 (comment 2092272041)index_sbom_component_versions_on_component_id_and_version.
Edited by Fabien Catteau