Draft: Remove identifier_external_reads 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).
DB review
rake db:migrate:up:main
main: == [advisory_lock_connection] object_id: 128380, pg_backend_pid: 44969
main: == 20240903081448 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: migrating
main: -- remove_column(:vulnerability_reads, :identifier_external_ids)
main: -> 0.0014s
main: == 20240903081448 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: migrated (0.0044s)
main: == [advisory_lock_connection] object_id: 128380, pg_backend_pid: 44969
rake db:migrate_down:main
main: == [advisory_lock_connection] object_id: 128000, pg_backend_pid: 40615
main: == 20240903081448 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: reverting
main: -- add_column(:vulnerability_reads, :identifier_external_ids, :text, {:array=>true, :default=>[], :null=>false})
main: -> 0.0034s
main: == 20240903081448 RemoveVulnerabilityReadsIdentifierExternalIdsColumn: reverted (0.0062s)
main: == [advisory_lock_connection] object_id: 128000, pg_backend_pid: 40615
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
Edited by Rushik Subba