Add tsvector index on smart_contracts.name (#9487)
* Add tsvector index on smart_contracts.name * Changelogpull/9524/head
parent
4e82187916
commit
7467d4d075
@ -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…
Reference in new issue