diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-12 15:13:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-12 15:13:54 +0000 |
commit | 98638cd5e43611aac2193a5c2f80f72374040430 (patch) | |
tree | 6605f0f284efed1d05708b3799f093eb5e305a8f /db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb | |
parent | 43d816ebc20da6ff959176248c70d8c4c7c9345a (diff) | |
download | gitlab-ce-98638cd5e43611aac2193a5c2f80f72374040430.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb')
-rw-r--r-- | db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb b/db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb new file mode 100644 index 00000000000..864e0e74b97 --- /dev/null +++ b/db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropPartialIndexDeploymentsForProjectIdAndTag < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'partial_index_deployments_for_project_id_and_tag' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :deployments, name: INDEX_NAME + end + + def down + # This is based on the following `CREATE INDEX` command in db/init_structure.sql: + # CREATE INDEX partial_index_deployments_for_project_id_and_tag ON deployments + # USING btree (project_id) WHERE (tag IS TRUE); + add_concurrent_index :deployments, :project_id, name: INDEX_NAME, where: 'tag IS TRUE' + end +end |