Add tsvector index on smart_contracts.name (#9487)

* Add tsvector index on smart_contracts.name

* Changelog
pull/9524/head
nikitosing 9 months ago committed by GitHub
parent 4e82187916
commit 7467d4d075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 13
      apps/explorer/priv/repo/migrations/20240227115149_add_smart_contracts_name_text_index.exs

@ -22,6 +22,8 @@
### Chore
- [#9487](https://github.com/blockscout/blockscout/pull/9487) - Add tsvector index on smart_contracts.name
<details>
<summary>Dependencies version bumps</summary>

@ -0,0 +1,13 @@
defmodule Explorer.Repo.Migrations.AddSmartContractsNameTextIndex do
use Ecto.Migration
def up do
execute("""
CREATE INDEX IF NOT EXISTS smart_contracts_trgm_idx ON smart_contracts USING GIN (to_tsvector('english', name))
""")
end
def down do
execute("DROP INDEX IF EXISTS smart_contracts_trgm_idx")
end
end
Loading…
Cancel
Save