diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 03:09:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-01 03:09:32 +0300 |
commit | 63eb68d33574d87a65f89a4ea1559749227226cb (patch) | |
tree | 4f3e593bbe30f7c9bf9d22baedb8886aabf870f4 /db | |
parent | 9c918ae5c688cf492589be0c082956fd72aacea7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb | 19 | ||||
-rw-r--r-- | db/migrate/20210331145548_add_index_for_last_deployment.rb | 18 | ||||
-rw-r--r-- | db/schema_migrations/20210326035553 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20210331145548 | 1 | ||||
-rw-r--r-- | db/structure.sql | 4 |
5 files changed, 43 insertions, 0 deletions
diff --git a/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb b/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb new file mode 100644 index 00000000000..d10c9401a31 --- /dev/null +++ b/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexForProjectDeploymentsWithEnvironmentIdAndUpdatedAt < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = 'index_deployments_on_project_and_environment_and_updated_at' + + def up + add_concurrent_index :deployments, [:project_id, :environment_id, :updated_at], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :deployments, INDEX_NAME + end +end diff --git a/db/migrate/20210331145548_add_index_for_last_deployment.rb b/db/migrate/20210331145548_add_index_for_last_deployment.rb new file mode 100644 index 00000000000..a50d8ea403a --- /dev/null +++ b/db/migrate/20210331145548_add_index_for_last_deployment.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexForLastDeployment < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_deployments_on_environment_id_status_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :deployments, [:environment_id, :status, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :deployments, INDEX_NAME + end +end diff --git a/db/schema_migrations/20210326035553 b/db/schema_migrations/20210326035553 new file mode 100644 index 00000000000..da34de0fafe --- /dev/null +++ b/db/schema_migrations/20210326035553 @@ -0,0 +1 @@ +018381c15d859a777afb2b3402ca4425ce52ab35dcd4d1e930b3a9928b2a2019
\ No newline at end of file diff --git a/db/schema_migrations/20210331145548 b/db/schema_migrations/20210331145548 new file mode 100644 index 00000000000..c903c6f35c8 --- /dev/null +++ b/db/schema_migrations/20210331145548 @@ -0,0 +1 @@ +f27446d1950acaf45f623b2cec7733cd7ba4b82eefddfa2203acbbaf77d59e18
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 6e38971a445..c1a2652ff12 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22520,12 +22520,16 @@ CREATE INDEX index_deployments_on_environment_id_and_iid_and_project_id ON deplo CREATE INDEX index_deployments_on_environment_id_status_and_finished_at ON deployments USING btree (environment_id, status, finished_at); +CREATE INDEX index_deployments_on_environment_id_status_and_id ON deployments USING btree (environment_id, status, id); + CREATE INDEX index_deployments_on_environment_status_sha ON deployments USING btree (environment_id, status, sha); CREATE INDEX index_deployments_on_id_and_status_and_created_at ON deployments USING btree (id, status, created_at); CREATE INDEX index_deployments_on_id_where_cluster_id_present ON deployments USING btree (id) WHERE (cluster_id IS NOT NULL); +CREATE INDEX index_deployments_on_project_and_environment_and_updated_at ON deployments USING btree (project_id, environment_id, updated_at); + CREATE INDEX index_deployments_on_project_and_finished ON deployments USING btree (project_id, finished_at) WHERE (status = 2); CREATE INDEX index_deployments_on_project_id_and_id ON deployments USING btree (project_id, id DESC); |