summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-04 03:09:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-04 03:09:50 +0000
commit21be9646a94e2c145897e25d9c521523d55e1614 (patch)
tree2873c5461d2222f9e51ba9cea9d2ed87d3f87e20 /db
parent933d8b6d85b56a2f0f9d8ffe54f0212422537b03 (diff)
downloadgitlab-ce-21be9646a94e2c145897e25d9c521523d55e1614.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200402115013_add_index_on_modsecurity_to_ingress.rb18
-rw-r--r--db/migrate/20200402115623_add_index_on_successful_deployment_and_environment_id_to_deployments.rb18
-rw-r--r--db/migrate/20200420141733_add_index_on_enabled_clusters.rb18
-rw-r--r--db/structure.sql9
4 files changed, 63 insertions, 0 deletions
diff --git a/db/migrate/20200402115013_add_index_on_modsecurity_to_ingress.rb b/db/migrate/20200402115013_add_index_on_modsecurity_to_ingress.rb
new file mode 100644
index 00000000000..8bd2d957092
--- /dev/null
+++ b/db/migrate/20200402115013_add_index_on_modsecurity_to_ingress.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexOnModsecurityToIngress < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_clusters_applications_ingress_on_modsecurity'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :clusters_applications_ingress, [:modsecurity_enabled, :modsecurity_mode, :cluster_id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index :clusters_applications_ingress, [:modsecurity_enabled, :modsecurity_mode, :cluster_id], name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20200402115623_add_index_on_successful_deployment_and_environment_id_to_deployments.rb b/db/migrate/20200402115623_add_index_on_successful_deployment_and_environment_id_to_deployments.rb
new file mode 100644
index 00000000000..c86f7ad63f0
--- /dev/null
+++ b/db/migrate/20200402115623_add_index_on_successful_deployment_and_environment_id_to_deployments.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexOnSuccessfulDeploymentAndEnvironmentIdToDeployments < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_successful_deployments_on_cluster_id_and_environment_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :deployments, [:cluster_id, :environment_id], where: 'status = 2', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index :deployments, [:cluster_id, :environment_id], where: 'status = 2', name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20200420141733_add_index_on_enabled_clusters.rb b/db/migrate/20200420141733_add_index_on_enabled_clusters.rb
new file mode 100644
index 00000000000..43f4b072c82
--- /dev/null
+++ b/db/migrate/20200420141733_add_index_on_enabled_clusters.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexOnEnabledClusters < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_enabled_clusters_on_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :clusters, [:id], where: 'enabled = true', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index :clusters, [:id], where: 'enabled = true', name: INDEX_NAME
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index c0a222b61df..11ceb670805 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -9289,6 +9289,8 @@ CREATE UNIQUE INDEX index_clusters_applications_helm_on_cluster_id ON public.clu
CREATE UNIQUE INDEX index_clusters_applications_ingress_on_cluster_id ON public.clusters_applications_ingress USING btree (cluster_id);
+CREATE INDEX index_clusters_applications_ingress_on_modsecurity ON public.clusters_applications_ingress USING btree (modsecurity_enabled, modsecurity_mode, cluster_id);
+
CREATE UNIQUE INDEX index_clusters_applications_jupyter_on_cluster_id ON public.clusters_applications_jupyter USING btree (cluster_id);
CREATE INDEX index_clusters_applications_jupyter_on_oauth_application_id ON public.clusters_applications_jupyter USING btree (oauth_application_id);
@@ -9421,6 +9423,8 @@ CREATE UNIQUE INDEX index_emails_on_email ON public.emails USING btree (email);
CREATE INDEX index_emails_on_user_id ON public.emails USING btree (user_id);
+CREATE INDEX index_enabled_clusters_on_id ON public.clusters USING btree (id) WHERE (enabled = true);
+
CREATE INDEX index_environments_on_auto_stop_at ON public.environments USING btree (auto_stop_at) WHERE (auto_stop_at IS NOT NULL);
CREATE INDEX index_environments_on_name_varchar_pattern_ops ON public.environments USING btree (name varchar_pattern_ops);
@@ -10525,6 +10529,8 @@ CREATE INDEX index_subscriptions_on_project_id ON public.subscriptions USING btr
CREATE UNIQUE INDEX index_subscriptions_on_subscribable_and_user_id_and_project_id ON public.subscriptions USING btree (subscribable_id, subscribable_type, user_id, project_id);
+CREATE INDEX index_successful_deployments_on_cluster_id_and_environment_id ON public.deployments USING btree (cluster_id, environment_id) WHERE (status = 2);
+
CREATE UNIQUE INDEX index_suggestions_on_note_id_and_relative_order ON public.suggestions USING btree (note_id, relative_order);
CREATE UNIQUE INDEX index_system_note_metadata_on_description_version_id ON public.system_note_metadata USING btree (description_version_id) WHERE (description_version_id IS NOT NULL);
@@ -13542,6 +13548,8 @@ COPY "schema_migrations" (version) FROM STDIN;
20200401095430
20200401211005
20200402001106
+20200402115013
+20200402115623
20200402123926
20200402124802
20200402135250
@@ -13607,6 +13615,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200420104303
20200420104323
20200420115948
+20200420141733
20200420162730
20200420172113
20200420172752