diff options
Diffstat (limited to 'db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb')
-rw-r--r-- | db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb b/db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb new file mode 100644 index 00000000000..d8d3360221c --- /dev/null +++ b/db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class PrepareAsyncIndexForSecurityScansOnPipelineIdAndScanType < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_security_scans_on_pipeline_id_and_scan_type' + + disable_ddl_transaction! + + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402978 + def up + prepare_async_index :security_scans, [:pipeline_id, :scan_type], name: INDEX_NAME + end + + def down + unprepare_async_index :security_scans, [:pipeline_id, :scan_type], name: INDEX_NAME + end +end |