summaryrefslogtreecommitdiff
path: root/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb')
-rw-r--r--db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb b/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
new file mode 100644
index 00000000000..81903230f43
--- /dev/null
+++ b/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexToComplianceManagementFrameworksPipelineConfiguration < ActiveRecord::Migration[6.1]
+ include Gitlab::Database::MigrationHelpers
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_compliance_frameworks_id_where_frameworks_not_null'
+
+ def up
+ add_concurrent_index :compliance_management_frameworks, :id, name: INDEX_NAME, where: 'pipeline_configuration_full_path IS NOT NULL'
+ end
+
+ def down
+ remove_concurrent_index_by_name :compliance_management_frameworks, INDEX_NAME
+ end
+end