Skip to content

Drop `due_date` Column From Vulnerabilities

What does this MR do and why?

due_date is an ignored column (source)

This MR drops the column for step 2 of the 3-MR drop column process

Check for indexes or constraints

Using the command \d+ vulnerabilities on postgres.ai indicates there are NOT indexes and constraints

index fk constraint
image image

migration output

bundle exec rails db:migrate output
~/gitlab-development-kit/gitlab$ bundle exec rails db:migrate
main: == [advisory_lock_connection] object_id: 182860, pg_backend_pid: 75761
main: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: migrating ===========
main: -- remove_column(:vulnerabilities, :due_date)
main:    -> 0.0101s
main: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: migrated (0.0130s) ==

main: == [advisory_lock_connection] object_id: 182860, pg_backend_pid: 75761
ci: == [advisory_lock_connection] object_id: 183100, pg_backend_pid: 75763
ci: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: migrating ===========
ci: -- remove_column(:vulnerabilities, :due_date)
ci:    -> 0.0011s
ci: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: migrated (0.0075s) ==

ci: == [advisory_lock_connection] object_id: 183100, pg_backend_pid: 75763
bundle exec rails db:rollback:main output
~/gitlab-development-kit/gitlab$ bundle exec rails db:rollback:main
main: == [advisory_lock_connection] object_id: 182440, pg_backend_pid: 74504
main: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: reverting ===========
main: -- add_column(:vulnerabilities, :due_date, :date)
main:    -> 0.0012s
main: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: reverted (0.0049s) ==

main: == [advisory_lock_connection] object_id: 182440, pg_backend_pid: 74504
bundle exec rails db:rollback:ci output
~/gitlab-development-kit/gitlab$ bundle exec rails db:rollback:ci
ci: == [advisory_lock_connection] object_id: 182380, pg_backend_pid: 74845
ci: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: reverting ===========
ci: -- add_column(:vulnerabilities, :due_date, :date)
ci:    -> 0.0026s
ci: == 20231225133628 RemoveDueDateColumnFromVulnerabilities: reverted (0.0094s) ==

ci: == [advisory_lock_connection] object_id: 182380, pg_backend_pid: 74845

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #268154 (closed)

Edited by Michael Becker

Merge request reports

Loading