diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 18:06:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 18:06:00 +0000 |
commit | ea4762d464bb36f3e36e318db47086e41f493377 (patch) | |
tree | c2fb2b7d2eb2b775d9ab149dc3781975fcc4b7d5 /db | |
parent | 68b6846fa6c7b630cc8dab7a8474dcc34e4d67d4 (diff) | |
download | gitlab-ce-ea4762d464bb36f3e36e318db47086e41f493377.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20191111175230_add_index_on_ci_pipelines_updated_at.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20191111175230_add_index_on_ci_pipelines_updated_at.rb b/db/migrate/20191111175230_add_index_on_ci_pipelines_updated_at.rb new file mode 100644 index 00000000000..566bb16ac65 --- /dev/null +++ b/db/migrate/20191111175230_add_index_on_ci_pipelines_updated_at.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnCiPipelinesUpdatedAt < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_COLUMNS = [:project_id, :status, :updated_at] + + disable_ddl_transaction! + + def up + add_concurrent_index(:ci_pipelines, INDEX_COLUMNS) + end + + def down + remove_concurrent_index(:ci_pipelines, INDEX_COLUMNS) + end +end diff --git a/db/schema.rb b/db/schema.rb index 7b21db5b098..5c22ef8fe4b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -851,6 +851,7 @@ ActiveRecord::Schema.define(version: 2019_11_19_023952) do t.index ["project_id", "sha"], name: "index_ci_pipelines_on_project_id_and_sha" t.index ["project_id", "source"], name: "index_ci_pipelines_on_project_id_and_source" t.index ["project_id", "status", "config_source"], name: "index_ci_pipelines_on_project_id_and_status_and_config_source" + t.index ["project_id", "status", "updated_at"], name: "index_ci_pipelines_on_project_id_and_status_and_updated_at" t.index ["project_id"], name: "index_ci_pipelines_on_project_id" t.index ["status"], name: "index_ci_pipelines_on_status" t.index ["user_id"], name: "index_ci_pipelines_on_user_id" |