diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
commit | 585826cb22ecea5998a2c2a4675735c94bdeedac (patch) | |
tree | 5b05f0b30d33cef48963609e8a18a4dff260eab3 /db/post_migrate/20231027013210_remove_partial_index_deployments_for_legacy_successful_deployments.rb | |
parent | df221d036e5d0c6c0ee4d55b9c97f481ee05dee8 (diff) |
Add latest changes from gitlab-org/gitlab@16-6-stable-eev16.6.0-rc42
Diffstat (limited to 'db/post_migrate/20231027013210_remove_partial_index_deployments_for_legacy_successful_deployments.rb')
-rw-r--r-- | db/post_migrate/20231027013210_remove_partial_index_deployments_for_legacy_successful_deployments.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/post_migrate/20231027013210_remove_partial_index_deployments_for_legacy_successful_deployments.rb b/db/post_migrate/20231027013210_remove_partial_index_deployments_for_legacy_successful_deployments.rb new file mode 100644 index 00000000000..2bd52fdc10a --- /dev/null +++ b/db/post_migrate/20231027013210_remove_partial_index_deployments_for_legacy_successful_deployments.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemovePartialIndexDeploymentsForLegacySuccessfulDeployments < Gitlab::Database::Migration[2.2] + INDEX_NAME = 'partial_index_deployments_for_legacy_successful_deployments' + + milestone '16.6' + + 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_legacy_successful_deployments ON deployments + # USING btree (id) WHERE ((finished_at IS NULL) AND (status = 2)); + add_concurrent_index :deployments, :id, name: INDEX_NAME, where: '((finished_at IS NULL) AND (status = 2))' + end +end |