Drop `epic_id` Column From Vulnerabilities
What does this MR do and why?
epic_id
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 indexes and constraints
index | fk constraint |
---|---|
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: 947800
main: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: migrating ============
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- remove_column(:vulnerabilities, :epic_id)
main: -> 0.0015s
main: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: migrated (0.0129s) ===
main: == [advisory_lock_connection] object_id: 182860, pg_backend_pid: 947800
ci: == [advisory_lock_connection] object_id: 183100, pg_backend_pid: 947802
ci: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: migrating ============
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- remove_column(:vulnerabilities, :epic_id)
ci: -> 0.0023s
ci: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: migrated (0.0187s) ===
ci: == [advisory_lock_connection] object_id: 183100, pg_backend_pid: 947802
bundle exec rails db:rollback:main
output
~/gitlab-development-kit/gitlab$ bundle exec rails db:rollback:main
main: == [advisory_lock_connection] object_id: 182580, pg_backend_pid: 950470
main: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: reverting ============
main: -- column_exists?(:vulnerabilities, :epic_id)
main: -> 0.0255s
main: -- add_column(:vulnerabilities, :epic_id, :bigint)
main: -> 0.0011s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0010s
main: -- index_exists?(:vulnerabilities, :epic_id, {:algorithm=>:concurrently})
main: -> 0.0114s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- add_index(:vulnerabilities, :epic_id, {:algorithm=>:concurrently})
main: -> 0.0020s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: -- index_name(:vulnerabilities, :epic_id)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE vulnerabilities ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics (id) ON DELETE SET NULL NOT VALID;")
main: -> 0.0030s
main: -- execute("ALTER TABLE vulnerabilities VALIDATE CONSTRAINT fk_1d37cddf91;")
main: -> 0.0060s
main: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: reverted (0.0908s) ===
main: == [advisory_lock_connection] object_id: 182580, pg_backend_pid: 950470
bundle exec rails db:rollback:ci
output
~/gitlab-development-kit/gitlab$ bundle exec rails db:rollback:ci
ci: == [advisory_lock_connection] object_id: 182500, pg_backend_pid: 950946
ci: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: reverting ============
ci: -- column_exists?(:vulnerabilities, :epic_id)
ci: -> 0.0184s
ci: -- add_column(:vulnerabilities, :epic_id, :bigint)
ci: -> 0.0009s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci: -> 0.0009s
ci: -- index_exists?(:vulnerabilities, :epic_id, {:algorithm=>:concurrently})
ci: -> 0.0152s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0006s
ci: -- add_index(:vulnerabilities, :epic_id, {:algorithm=>:concurrently})
ci: -> 0.0015s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0004s
ci: -- index_name(:vulnerabilities, :epic_id)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE vulnerabilities ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics (id) ON DELETE SET NULL NOT VALID;")
ci: -> 0.0038s
ci: -- execute("ALTER TABLE vulnerabilities VALIDATE CONSTRAINT fk_1d37cddf91;")
ci: -> 0.0037s
ci: == 20231219132423 RemoveEpicIdColumnFromVulnerabilities: reverted (0.0951s) ===
ci: == [advisory_lock_connection] object_id: 182500, pg_backend_pid: 950946
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #268154 (closed)
Edited by Michael Becker