add migration for last commit

master
Aevann 2024-11-13 15:23:47 +02:00
parent 4cf3cfe59b
commit 17efb9c1c6
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
alter table posts add column title_ts tsvector GENERATED ALWAYS AS (to_tsvector('simple'::regconfig, (title)::text)) STORED;
alter table posts add column body_ts tsvector GENERATED ALWAYS AS (to_tsvector('simple'::regconfig, (body)::text)) STORED;
alter table posts add column url_ts tsvector GENERATED ALWAYS AS (to_tsvector('simple'::regconfig, (url)::text)) STORED;
alter table posts add column embed_ts tsvector GENERATED ALWAYS AS (to_tsvector('simple'::regconfig, (embed)::text)) STORED;
CREATE INDEX posts_title_ts_idx ON public.posts USING gin (title_ts);
CREATE INDEX posts_body_ts_idx ON public.posts USING gin (body_ts);
CREATE INDEX posts_url_ts_idx ON public.posts USING gin (url_ts);
CREATE INDEX posts_embed_ts_idx ON public.posts USING gin (embed_ts);