Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20200820105408_add_index_to_container_scanning_findings.rb')
-rw-r--r--db/migrate/20200820105408_add_index_to_container_scanning_findings.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20200820105408_add_index_to_container_scanning_findings.rb b/db/migrate/20200820105408_add_index_to_container_scanning_findings.rb
new file mode 100644
index 00000000000..834e11e3d6e
--- /dev/null
+++ b/db/migrate/20200820105408_add_index_to_container_scanning_findings.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddIndexToContainerScanningFindings < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'idx_container_scanning_findings'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:vulnerability_occurrences, :id,
+ where: "report_type = 2",
+ name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(:project_registry, INDEX_NAME)
+ end
+end