diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 09:09:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 09:09:48 +0000 |
commit | 3f3e4bcc50a3280d03299c2c263eafd9c8e3bd7b (patch) | |
tree | eccfc6b87b404f2871cc795bf2f7223a7e391939 /db | |
parent | 65a1175e466105fca1f40cb5a995fdb100ff334e (diff) | |
download | gitlab-ce-3f3e4bcc50a3280d03299c2c263eafd9c8e3bd7b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200306170321_add_index_on_user_id_and_created_at_to_ci_pipelines.rb | 19 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/db/migrate/20200306170321_add_index_on_user_id_and_created_at_to_ci_pipelines.rb b/db/migrate/20200306170321_add_index_on_user_id_and_created_at_to_ci_pipelines.rb new file mode 100644 index 00000000000..b88f938d1c2 --- /dev/null +++ b/db/migrate/20200306170321_add_index_on_user_id_and_created_at_to_ci_pipelines.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexOnUserIdAndCreatedAtToCiPipelines < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_pipelines, [:user_id, :created_at] + remove_concurrent_index :ci_pipelines, [:user_id] + end + + def down + add_concurrent_index :ci_pipelines, [:user_id] + remove_concurrent_index :ci_pipelines, [:user_id, :created_at] + end +end diff --git a/db/schema.rb b/db/schema.rb index c45e7f053f3..62cce205424 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -873,7 +873,7 @@ ActiveRecord::Schema.define(version: 2020_03_09_195710) do 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 ["status"], name: "index_ci_pipelines_on_status" - t.index ["user_id"], name: "index_ci_pipelines_on_user_id" + t.index ["user_id", "created_at"], name: "index_ci_pipelines_on_user_id_and_created_at" end create_table "ci_pipelines_config", primary_key: "pipeline_id", force: :cascade do |t| |