Create new column on Approval Merge Request Rules
What does this MR do and why?
Currently after merge, we don't know if a merge request rule was applicable to the merge request at the time of merge.
We are introducing this column to be used after merge to record the state at the time of merge.
Down and Up migrations
➜ gitlab git:(create_new_column_on_merge_request_approval_rule) ✗ bundle exec rake db:migrate:down:main VERSION=20230928073320
main: == [advisory_lock_connection] object_id: 227080, pg_backend_pid: 93118
main: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: reverting ====
main: -- remove_column(:approval_merge_request_rules, :applicable_post_merge, :boolean)
main: -> 0.0040s
main: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: reverted (0.0110s)
main: == [advisory_lock_connection] object_id: 227080, pg_backend_pid: 93118
➜ gitlab git:(create_new_column_on_merge_request_approval_rule) ✗ bundle exec rake db:migrate:down:ci VERSION=20230928073320
ci: == [advisory_lock_connection] object_id: 226980, pg_backend_pid: 93545
ci: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: reverting ====
ci: -- remove_column(:approval_merge_request_rules, :applicable_post_merge, :boolean)
ci: -> 0.0068s
ci: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: reverted (0.0276s)
ci: == [advisory_lock_connection] object_id: 226980, pg_backend_pid: 93545
➜ gitlab git:(create_new_column_on_merge_request_approval_rule) ✗ bundle exec rake db:migrate
main: == [advisory_lock_connection] object_id: 228300, pg_backend_pid: 93995
main: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: migrating ====
main: -- add_column(:approval_merge_request_rules, :applicable_post_merge, :boolean)
main: -> 0.0022s
main: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: migrated (0.0091s)
main: == [advisory_lock_connection] object_id: 228300, pg_backend_pid: 93995
ci: == [advisory_lock_connection] object_id: 228600, pg_backend_pid: 93997
ci: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: migrating ====
ci: -- add_column(:approval_merge_request_rules, :applicable_post_merge, :boolean)
ci: -> 0.0025s
ci: == 20230928073320 AddApplicablePostMergeColumnToMrApprovalRules: migrated (0.0141s)
ci: == [advisory_lock_connection] object_id: 228600, pg_backend_pid: 93997
➜ gitlab git:(create_new_column_on_merge_request_approval_rule) ✗
Edited by Marc Shaw