fix(migrations): Fix search index creation in user migration
This commit is contained in:
parent
2159c76ca7
commit
02c15f06d6
2 changed files with 4 additions and 0 deletions
|
@ -55,6 +55,8 @@ CREATE MATERIALIZED VIEW search_index AS
|
|||
JOIN threads t
|
||||
ON t.id = p.thread_id;
|
||||
|
||||
CREATE INDEX idx_fts_search ON search_index USING gin(document);
|
||||
|
||||
-- and drop the users table and columns:
|
||||
ALTER TABLE posts DROP COLUMN author;
|
||||
ALTER TABLE threads DROP COLUMN author;
|
||||
|
|
|
@ -68,6 +68,8 @@ CREATE MATERIALIZED VIEW search_index AS
|
|||
JOIN users ta ON ta.id = t.author
|
||||
JOIN users pa ON pa.id = p.author;
|
||||
|
||||
CREATE INDEX idx_fts_search ON search_index USING gin(document);
|
||||
|
||||
-- And drop the old fields:
|
||||
ALTER TABLE posts DROP COLUMN author_name;
|
||||
ALTER TABLE posts DROP COLUMN author_email;
|
||||
|
|
Loading…
Reference in a new issue