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/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb')
-rw-r--r--db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb b/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb
new file mode 100644
index 00000000000..111486a17ab
--- /dev/null
+++ b/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddOwnerAndIdIndexOnActiveCiPipelineSchedules < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_ci_pipeline_schedules_on_owner_id_and_id_and_active'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :ci_pipeline_schedules, [:owner_id, :id], where: "active = TRUE", name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :ci_pipeline_schedules, INDEX_NAME
+ end
+end