Skip to content

Add 'NOT NULL' to 'has_merge_request' in 'vulnerability_reads' table

Siddharth Asthana requested to merge edith007/gitlab:issues_425060 into master

What does this MR do and why?

This MR aims to solve the issue #425060 (closed)

Add 'NOT NULL' to 'has_merge_request' in 'vulnerability_reads' table

We found that the 'has_merge_request' column could have empty values, which wasn't what we wanted. We've now made sure that this column can't be empty, just like other similar columns in the same table.

Up

bin/rails db:migrate:up:main VERSION=20240222000001
main: == [advisory_lock_connection] object_id: 117760, pg_backend_pid: 33466
main: == [advisory_lock_connection] object_id: 117760, pg_backend_pid: 33466

Down

bin/rails db:migrate:down:main VERSION=20240222000001
main: == [advisory_lock_connection] object_id: 117760, pg_backend_pid: 33882
main: == 20240222000001 AddNotNullConstraintToHasMergeRequest: reverting ============
main: -- transaction_open?(nil)
main:    -> 0.0001s
main: -- transaction_open?(nil)
main:    -> 0.0000s
main: -- execute("            ALTER TABLE vulnerability_reads\n            DROP CONSTRAINT IF EXISTS check_4b1a1bf5ea\n")
main:    -> 0.0115s
main: == 20240222000001 AddNotNullConstraintToHasMergeRequest: reverted (0.0751s) ===main: == [advisory_lock_connection] object_id: 117760, pg_backend_pid: 33882

MR acceptance checklist

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

Edited by Siddharth Asthana

Merge request reports