Remove identifier_external_ids column from vulnerability_reads
What does this MR do and why?
MR to drop the identifier_external_ids
from vulnerability_reads
table. This column was added to support filtering vulnerabilities by identifier, but is no longer needed since we have decided to use identifier_names
column for the same (New plan).
Column was ignored in this !162999 (merged)
DB review
rake db:migrate:up:main
main: == [advisory_lock_connection] object_id: 128000, pg_backend_pid: 89934
main: == 20240903132835 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: migrating
main: -- remove_column(:vulnerability_reads, :identifier_external_ids)
main: -> 0.0013s
main: == 20240903132835 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: migrated (0.0045s)
main: == [advisory_lock_connection] object_id: 128000, pg_backend_pid: 89934
rake db:migrate_down:main
main: == [advisory_lock_connection] object_id: 128000, pg_backend_pid: 89458
main: == 20240903132835 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: reverting
main: -- add_column(:vulnerability_reads, :identifier_external_ids, :text, {:array=>true, :default=>[], :null=>false})
main: -> 0.0020s
main: == 20240903132835 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: reverted (0.0055s)
main: == [advisory_lock_connection] object_id: 128000, pg_backend_pid: 89458
How to set up and validate locally
- Should be able to run the migration locally.
- Verify the column is dropped by running
bundle exec rake db:migrate:up:main VERSION=20240903081448
and created by runningbundle exec rake db:migrate:down:main VERSION=20240903081448
by inspecting thevulnerability_reads
table in psql:\d+ vulnerability_reads
Relates to #479531 (closed)
Edited by Rushik Subba