diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-12-06 14:23:36 +0300 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-12-06 14:23:36 +0300 |
commit | cebd595eaaf86f04015011bfb4e173cfa797479c (patch) | |
tree | 792c9e3bdff4fb5296e1ab69e444f7622f937614 /db/migrate | |
parent | 28951d56b35cd758b73bf56a79dd8ba94e1dc15b (diff) | |
parent | 0e8b9c4a1ecbd3e52ba379494872e019ec7edfe1 (diff) |
Merge branch 'partial-index-for-merge_request_id' into 'master'
Use partial index on `merge_request_id`
Closes #54913
See merge request gitlab-org/gitlab-ce!23609
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20181120091639_add_foreign_key_to_ci_pipelines_merge_requests.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20181120091639_add_foreign_key_to_ci_pipelines_merge_requests.rb b/db/migrate/20181120091639_add_foreign_key_to_ci_pipelines_merge_requests.rb index c2b5b239279..03f677a4678 100644 --- a/db/migrate/20181120091639_add_foreign_key_to_ci_pipelines_merge_requests.rb +++ b/db/migrate/20181120091639_add_foreign_key_to_ci_pipelines_merge_requests.rb @@ -8,7 +8,7 @@ class AddForeignKeyToCiPipelinesMergeRequests < ActiveRecord::Migration disable_ddl_transaction! def up - add_concurrent_index :ci_pipelines, :merge_request_id + add_concurrent_index :ci_pipelines, :merge_request_id, where: 'merge_request_id IS NOT NULL' add_concurrent_foreign_key :ci_pipelines, :merge_requests, column: :merge_request_id, on_delete: :cascade end @@ -17,6 +17,6 @@ class AddForeignKeyToCiPipelinesMergeRequests < ActiveRecord::Migration remove_foreign_key :ci_pipelines, :merge_requests end - remove_concurrent_index :ci_pipelines, :merge_request_id + remove_concurrent_index :ci_pipelines, :merge_request_id, where: 'merge_request_id IS NOT NULL' end end |