diff options
Diffstat (limited to 'db/post_migrate/20231122011731_drop_index_users_on_email_trigram.rb')
-rw-r--r-- | db/post_migrate/20231122011731_drop_index_users_on_email_trigram.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/post_migrate/20231122011731_drop_index_users_on_email_trigram.rb b/db/post_migrate/20231122011731_drop_index_users_on_email_trigram.rb new file mode 100644 index 00000000000..79e30651237 --- /dev/null +++ b/db/post_migrate/20231122011731_drop_index_users_on_email_trigram.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DropIndexUsersOnEmailTrigram < Gitlab::Database::Migration[2.2] + milestone '16.7' + + disable_ddl_transaction! + + TABLE_NAME = :users + INDEX_NAME = :index_users_on_email_trigram + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, :email, name: INDEX_NAME, + using: :gin, opclass: { email: :gin_trgm_ops } + end +end |