summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 21:09:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 21:09:21 +0000
commit87af6f2e0590af0ed1bb3e5de1bb5d21855a94d2 (patch)
tree2abe2661b10cf6281bc03855b3053a072c64fbbf /db
parentc43ba2677f41ad0b5fc6f3af6baf4266c70dfcb3 (diff)
downloadgitlab-ce-87af6f2e0590af0ed1bb3e5de1bb5d21855a94d2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200310123229_add_index_on_enabled_and_provider_type_and_id_to_clusters.rb19
-rw-r--r--db/schema.rb2
2 files changed, 20 insertions, 1 deletions
diff --git a/db/migrate/20200310123229_add_index_on_enabled_and_provider_type_and_id_to_clusters.rb b/db/migrate/20200310123229_add_index_on_enabled_and_provider_type_and_id_to_clusters.rb
new file mode 100644
index 00000000000..edd9343e743
--- /dev/null
+++ b/db/migrate/20200310123229_add_index_on_enabled_and_provider_type_and_id_to_clusters.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddIndexOnEnabledAndProviderTypeAndIdToClusters < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :clusters, [:enabled, :provider_type, :id]
+ remove_concurrent_index :clusters, :enabled
+ end
+
+ def down
+ add_concurrent_index :clusters, :enabled
+ remove_concurrent_index :clusters, [:enabled, :provider_type, :id]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 83aa4a32ffb..c089c4f123a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1125,7 +1125,7 @@ ActiveRecord::Schema.define(version: 2020_03_12_163407) do
t.integer "management_project_id"
t.integer "cleanup_status", limit: 2, default: 1, null: false
t.text "cleanup_status_reason"
- t.index ["enabled"], name: "index_clusters_on_enabled"
+ t.index ["enabled", "provider_type", "id"], name: "index_clusters_on_enabled_and_provider_type_and_id"
t.index ["management_project_id"], name: "index_clusters_on_management_project_id", where: "(management_project_id IS NOT NULL)"
t.index ["user_id"], name: "index_clusters_on_user_id"
end