diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 12:09:13 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-18 12:09:13 +0000 |
commit | 1363ca12f1f07c634647cf55c4c16b7401098673 (patch) | |
tree | d932caf09c8148322edb51ae954ed159ff7d00f8 /db | |
parent | 6763d2787670bc03a36a8eb601703e88fc70dece (diff) | |
download | gitlab-ce-1363ca12f1f07c634647cf55c4c16b7401098673.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200311141943_insert_ci_pipeline_schedules_plan_limits.rb | 2 | ||||
-rw-r--r-- | db/migrate/20200312160532_add_index_on_mirror_and_id_to_projects.rb | 21 | ||||
-rw-r--r-- | db/schema.rb | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/db/migrate/20200311141943_insert_ci_pipeline_schedules_plan_limits.rb b/db/migrate/20200311141943_insert_ci_pipeline_schedules_plan_limits.rb index d1ad5be5f85..849d95667a7 100644 --- a/db/migrate/20200311141943_insert_ci_pipeline_schedules_plan_limits.rb +++ b/db/migrate/20200311141943_insert_ci_pipeline_schedules_plan_limits.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class InsertCiPipelineSchedulesPlanLimits < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + DOWNTIME = false def change diff --git a/db/migrate/20200312160532_add_index_on_mirror_and_id_to_projects.rb b/db/migrate/20200312160532_add_index_on_mirror_and_id_to_projects.rb new file mode 100644 index 00000000000..3a64b915931 --- /dev/null +++ b/db/migrate/20200312160532_add_index_on_mirror_and_id_to_projects.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddIndexOnMirrorAndIdToProjects < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + OLD_INDEX_NAME = 'index_projects_on_mirror_and_mirror_trigger_builds_both_true' + NEW_INDEX_NAME = 'index_projects_on_mirror_id_where_mirror_and_trigger_builds' + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, :id, where: 'mirror = TRUE AND mirror_trigger_builds = TRUE', name: NEW_INDEX_NAME + remove_concurrent_index_by_name :projects, OLD_INDEX_NAME + end + + def down + add_concurrent_index :projects, :id, where: 'mirror IS TRUE AND mirror_trigger_builds IS TRUE', name: OLD_INDEX_NAME + remove_concurrent_index_by_name :projects, NEW_INDEX_NAME + end +end diff --git a/db/schema.rb b/db/schema.rb index 1e32f4e6bd4..9edc1d9853c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -3507,7 +3507,7 @@ ActiveRecord::Schema.define(version: 2020_03_13_123934) do t.index ["id"], name: "index_on_id_partial_with_legacy_storage", where: "((storage_version < 2) OR (storage_version IS NULL))" t.index ["id"], name: "index_projects_on_id_partial_for_visibility", unique: true, where: "(visibility_level = ANY (ARRAY[10, 20]))" t.index ["id"], name: "index_projects_on_id_service_desk_enabled", where: "(service_desk_enabled = true)" - t.index ["id"], name: "index_projects_on_mirror_and_mirror_trigger_builds_both_true", where: "((mirror IS TRUE) AND (mirror_trigger_builds IS TRUE))" + t.index ["id"], name: "index_projects_on_mirror_id_where_mirror_and_trigger_builds", where: "((mirror = true) AND (mirror_trigger_builds = true))" t.index ["last_activity_at", "id"], name: "index_projects_api_last_activity_at_id_desc", order: { id: :desc } t.index ["last_activity_at", "id"], name: "index_projects_api_vis20_last_activity_at", where: "(visibility_level = 20)" t.index ["last_activity_at", "id"], name: "index_projects_on_last_activity_at_and_id" |