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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-20 15:10:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-20 15:10:03 +0300
commit43b4b3e2d2ddebc0a89b94a8251c162ec5719780 (patch)
tree8a21146370cfd1b24b25cfcacef53e889746f5aa /db/migrate/20200318163148_add_index_on_external_key_to_issues_table.rb
parent196ada0844fff7642463fbd08a44609a1e1fa713 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200318163148_add_index_on_external_key_to_issues_table.rb')
-rw-r--r--db/migrate/20200318163148_add_index_on_external_key_to_issues_table.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20200318163148_add_index_on_external_key_to_issues_table.rb b/db/migrate/20200318163148_add_index_on_external_key_to_issues_table.rb
new file mode 100644
index 00000000000..adca6c3b493
--- /dev/null
+++ b/db/migrate/20200318163148_add_index_on_external_key_to_issues_table.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexOnExternalKeyToIssuesTable < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:issues, [:project_id, :external_key], unique: true, where: 'external_key IS NOT NULL')
+ end
+
+ def down
+ remove_concurrent_index(:issues, [:project_id, :external_key])
+ end
+end