tetratto/sql_changes/posts_tscvector_content.sql

5 lines
206 B
MySQL
Raw Normal View History

2025-05-18 16:43:56 -04:00
ALTER TABLE posts
ADD COLUMN tsvector_content tsvector GENERATED ALWAYS AS (to_tsvector ('english', coalesce(content, ''))) STORED;
CREATE INDEX tsvector_content_idx ON posts USING GIN (tsvector_content);