Skip to content

Add default value to the scanner column in approval_merge_request_rules

What does this MR do and why?

Add default to scanners column from approval_merge_request_rules.

Database lab:

exec alter table approval_project_rules alter column scanners set default '{}';   
Session: 13222.  
The query has been executed. Duration: 55.817 ms (edited)    

Migration/Rollback:

$ bundle exec rails db:rollback:main STEP=1
main: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: reverting ========
main: -- change_column_default(:approval_project_rules, :scanners, {:from=>[], :to=>nil})
main:    -> 0.0086s
main: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: reverted (0.0087s)

$ bundle exec rails db:rollback:ci STEP=1
ci: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: reverting ========
ci: -- change_column_default(:approval_project_rules, :scanners, {:from=>[], :to=>nil})
ci:    -> 0.0093s
ci: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: reverted (0.0104s)

$ bundle exec rails db:migrate
main: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: migrating ========
main: -- change_column_default(:approval_project_rules, :scanners, {:from=>nil, :to=>[]})
main:    -> 0.0109s
main: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: migrated (0.0114s)

ci: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: migrating ========
ci: -- change_column_default(:approval_project_rules, :scanners, {:from=>nil, :to=>[]})
ci:    -> 0.0076s
ci: == 20221109160052 AddDefaultForApprovalProjectRulesScanners: migrated (0.0077s)

MR acceptance checklist

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

Merge request reports

Loading