diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /db/migrate/20220726230052_remove_tmp_index_project_membership_namespace_id_column.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) | |
download | gitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'db/migrate/20220726230052_remove_tmp_index_project_membership_namespace_id_column.rb')
-rw-r--r-- | db/migrate/20220726230052_remove_tmp_index_project_membership_namespace_id_column.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20220726230052_remove_tmp_index_project_membership_namespace_id_column.rb b/db/migrate/20220726230052_remove_tmp_index_project_membership_namespace_id_column.rb new file mode 100644 index 00000000000..e50665c106b --- /dev/null +++ b/db/migrate/20220726230052_remove_tmp_index_project_membership_namespace_id_column.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveTmpIndexProjectMembershipNamespaceIdColumn < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'tmp_index_for_namespace_id_migration_on_project_members' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :members, INDEX_NAME + end + + def down + add_concurrent_index :members, :id, + where: "members.member_namespace_id IS NULL and members.type = 'ProjectMember'", + name: INDEX_NAME + end +end |