diff --git a/libs/migrate/sql/m20250628_000080_add_message_reactions_and_search.sql b/libs/migrate/sql/m20250628_000080_add_message_reactions_and_search.sql index 69e558d..f65db89 100644 --- a/libs/migrate/sql/m20250628_000080_add_message_reactions_and_search.sql +++ b/libs/migrate/sql/m20250628_000080_add_message_reactions_and_search.sql @@ -29,12 +29,12 @@ CREATE INDEX IF NOT EXISTS idx_room_message_content_tsv ON room_message USING GI -- Trigger to auto-update content_tsv on insert/update CREATE OR REPLACE FUNCTION room_message_tsv_trigger() RETURNS TRIGGER AS -' - BEGIN - NEW.content_tsv := to_tsvector(''simple'', COALESCE(NEW.content, '''')); - RETURN NEW; - END; -' LANGUAGE plpgsql; +$$ +BEGIN + NEW.content_tsv := to_tsvector('simple', COALESCE(NEW.content, '')); + RETURN NEW; +END; +$$ LANGUAGE plpgsql; CREATE TRIGGER room_message_tsv_update BEFORE INSERT OR UPDATE