diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-23 12:10:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-23 12:10:45 +0300 |
commit | cd40f83527ac4ed4751b4b7849f0416996589d18 (patch) | |
tree | 201a36d826fc98f14ee1a7a1dc806b32f51cac00 /db | |
parent | d5f3372f10b9fefc8cf831515152eee7ae908f69 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20210219111040_add_epic_issue_composite_index.rb | 18 | ||||
-rw-r--r-- | db/schema_migrations/20210219111040 | 1 | ||||
-rw-r--r-- | db/structure.sql | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20210219111040_add_epic_issue_composite_index.rb b/db/migrate/20210219111040_add_epic_issue_composite_index.rb new file mode 100644 index 00000000000..f1344baf0c7 --- /dev/null +++ b/db/migrate/20210219111040_add_epic_issue_composite_index.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddEpicIssueCompositeIndex < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_epic_issues_on_epic_id_and_issue_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :epic_issues, [:epic_id, :issue_id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :epic_issues, INDEX_NAME + end +end diff --git a/db/schema_migrations/20210219111040 b/db/schema_migrations/20210219111040 new file mode 100644 index 00000000000..a006ece2f6c --- /dev/null +++ b/db/schema_migrations/20210219111040 @@ -0,0 +1 @@ +546802f93f64e346b066438e78ace5d2dc54de8a5f6234c2d01296a239cfe74c
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 09f1b91dc28..fe14f23af3a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22125,6 +22125,8 @@ CREATE INDEX index_environments_on_state_and_auto_stop_at ON environments USING CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); +CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id); + CREATE UNIQUE INDEX index_epic_issues_on_issue_id ON epic_issues USING btree (issue_id); CREATE INDEX index_epic_metrics ON epic_metrics USING btree (epic_id); |