You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
decentralised_book_index/priv/repo/migrations/20250427175337_add_gin_inde...

43 lines
1.5 KiB

defmodule DecentralisedBookIndex.Repo.Migrations.AddGinIndexes do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
execute("CREATE EXTENSION IF NOT EXISTS \"pg_trgm\"")
create index(:publishers, ["name gin_trgm_ops"],
name: "publisher_name_gin_index",
using: "GIN"
)
create index(:dbi_servers, ["name gin_trgm_ops"], name: "server_name_gin_index", using: "GIN")
create index(:books, ["title gin_trgm_ops"], name: "book_title_gin_index", using: "GIN")
create index(:book_ids, ["bid gin_trgm_ops"], name: "book_id_bid_gin_index", using: "GIN")
create index(:book_ids, ["type gin_trgm_ops"], name: "book_id_type_gin_index", using: "GIN")
create index(:authors, ["name gin_trgm_ops"], name: "author_name_gin_index", using: "GIN")
end
def down do
drop_if_exists index(:authors, ["name gin_trgm_ops"], name: "author_name_gin_index")
drop_if_exists index(:book_ids, ["type gin_trgm_ops"], name: "book_id_type_gin_index")
drop_if_exists index(:book_ids, ["bid gin_trgm_ops"], name: "book_id_bid_gin_index")
drop_if_exists index(:books, ["title gin_trgm_ops"], name: "book_title_gin_index")
drop_if_exists index(:dbi_servers, ["name gin_trgm_ops"], name: "server_name_gin_index")
drop_if_exists index(:publishers, ["name gin_trgm_ops"], name: "publisher_name_gin_index")
end
end