Skip to content

Commit

Permalink
chore: update fuzzey match migration
Browse files Browse the repository at this point in the history
  • Loading branch information
carere committed Jan 17, 2025
1 parent 762c9bb commit e80d315
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
-- +goose NO TRANSACTION
-- +goose Up
-- +goose StatementBegin
CREATE EXTENSION pg_trgm;
ALTER DATABASE marble SET pg_trgm.similarity_threshold = 0.1;
CREATE INDEX trgm_cases_on_name ON cases USING GIN (name gin_trgm_ops);
-- +goose StatementEnd
CREATE INDEX CONCURRENTLY trgm_cases_on_name ON cases USING GIN (name gin_trgm_ops);
CREATE INDEX CONCURRENTLY case_org_id_idx_2 ON cases(org_id, created_at DESC) INCLUDE(inbox_id, status, name);
DROP INDEX CONCURRENTLY IF EXISTS case_org_id_idx;
DROP INDEX CONCURRENTLY IF EXISTS case_status_idx;

-- +goose Down
-- +goose StatementBegin
DROP INDEX trgm_cases_on_name;
CREATE INDEX CONCURRENTLY case_status_idx ON cases(org_id, status, created_at DESC);
CREATE INDEX CONCURRENTLY case_org_id_idx ON cases(org_id, created_at DESC);
DROP INDEX CONCURRENTLY IF EXISTS case_org_id_idx_2;
DROP INDEX CONCURRENTLY IF EXISTS trgm_cases_on_name;
DROP EXTENSION pg_trgm;
-- +goose StatementEnd

0 comments on commit e80d315

Please sign in to comment.