diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 01:22:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 01:22:57 +0000 |
commit | 7fa016711e540f9b6dda45aa1f47867737c52940 (patch) | |
tree | 545fa4ba39a17df75301c6c90d7aef1e77cba98d /db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb | |
parent | ee3c8d00bd8c17201da0b116a9b3b276804b855f (diff) | |
download | gitlab-ce-7fa016711e540f9b6dda45aa1f47867737c52940.tar.gz |
Add latest changes from gitlab-org/gitlab@15-11-stable-ee
Diffstat (limited to 'db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb')
-rw-r--r-- | db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb b/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb new file mode 100644 index 00000000000..b01dbe642e2 --- /dev/null +++ b/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class UpdateDefaultScanMethodOfDastSiteProfile < Gitlab::Database::Migration[1.0] + BATCH_SIZE = 500 + + disable_ddl_transaction! + + def up + each_batch_range('dast_site_profiles', scope: ->(table) { table.where(target_type: 1) }, of: BATCH_SIZE) do |min, max| + execute <<~SQL + UPDATE dast_site_profiles + SET scan_method = 1 + WHERE id BETWEEN #{min} AND #{max} + SQL + end + end + + def down + # noop + end +end |