Add control fulltext search
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
10
pkg/coredata/migrations/20250607T173748Z.sql
Normal file
10
pkg/coredata/migrations/20250607T173748Z.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE controls ADD COLUMN search_vector tsvector
|
||||
GENERATED ALWAYS AS (
|
||||
to_tsvector('simple',
|
||||
COALESCE(section_title, '') || ' ' ||
|
||||
COALESCE(name, '') || ' ' ||
|
||||
COALESCE(description, '')
|
||||
)
|
||||
) STORED;
|
||||
|
||||
CREATE INDEX controls_search_idx ON controls USING gin(search_vector);
|
||||
Reference in New Issue
Block a user