-- +goose Up
CREATE EXTENSION IF NOT EXISTS pg_trgm;

CREATE INDEX idx_ingredient_mappings_canonical_ru_trgm
    ON ingredient_mappings USING GIN (canonical_name_ru gin_trgm_ops);

CREATE INDEX idx_ingredient_mappings_canonical_ru_fts
    ON ingredient_mappings USING GIN (to_tsvector('russian', coalesce(canonical_name_ru, '')));

-- +goose Down
DROP INDEX IF EXISTS idx_ingredient_mappings_canonical_ru_trgm;
DROP INDEX IF EXISTS idx_ingredient_mappings_canonical_ru_fts;
