diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 15:08:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-03 15:08:33 +0000 |
commit | 511e761b41b81484c85e3d125f45873ce38e9201 (patch) | |
tree | 6bb98a6356de6e1d736951d2eef6ec83e6aa3dd2 /db | |
parent | 4247e67be1faa9d52691757dad954a7fa63e8bfe (diff) | |
download | gitlab-ce-511e761b41b81484c85e3d125f45873ce38e9201.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200102170221_add_storage_version_index_to_projects.rb | 17 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 19 insertions, 1 deletions
diff --git a/db/migrate/20200102170221_add_storage_version_index_to_projects.rb b/db/migrate/20200102170221_add_storage_version_index_to_projects.rb new file mode 100644 index 00000000000..8965b5eedb9 --- /dev/null +++ b/db/migrate/20200102170221_add_storage_version_index_to_projects.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddStorageVersionIndexToProjects < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, :id, where: 'storage_version < 2 or storage_version IS NULL', name: 'index_on_id_partial_with_legacy_storage' + end + + def down + remove_concurrent_index :projects, :id, where: 'storage_version < 2 or storage_version IS NULL', name: 'index_on_id_partial_with_legacy_storage' + end +end diff --git a/db/schema.rb b/db/schema.rb index 567e135fdff..30e439b08c4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_12_29_140154) do +ActiveRecord::Schema.define(version: 2020_01_02_170221) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -3349,6 +3349,7 @@ ActiveRecord::Schema.define(version: 2019_12_29_140154) do t.index ["creator_id"], name: "index_projects_on_creator_id" t.index ["description"], name: "index_projects_on_description_trigram", opclass: :gin_trgm_ops, using: :gin t.index ["id", "repository_storage", "last_repository_updated_at"], name: "idx_projects_on_repository_storage_last_repository_updated_at" + 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_mirror_and_mirror_trigger_builds_both_true", where: "((mirror IS TRUE) AND (mirror_trigger_builds IS TRUE))" t.index ["last_activity_at"], name: "index_projects_on_last_activity_at" |