WIP: [questions][fix] workaround for prisma bug

hongpo/add-question-text-match
hpkoh 2 years ago
parent 2126cede0b
commit d96053dbbe

@ -1,8 +0,0 @@
-- AlterTable
ALTER TABLE "QuestionsQuestion" ADD COLUMN "contentSearch" TSVECTOR
GENERATED ALWAYS AS
to_tsvector('english', coalesce(content, ''))
STORED;
-- CreateIndex
CREATE INDEX "QuestionsQuestion_contentSearch_idx" ON "QuestionsQuestion" USING GIN("textSearch");

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "QuestionsQuestion" ADD COLUMN "contentSearch" tsvector;
-- CreateIndex
CREATE INDEX "QuestionsQuestion_contentSearch_idx" ON "QuestionsQuestion" USING GIN ("contentSearch");

@ -415,9 +415,9 @@ model QuestionsQuestion {
comments QuestionsQuestionComment[] comments QuestionsQuestionComment[]
answers QuestionsAnswer[] answers QuestionsAnswer[]
contentSearch Unsupported("TSVECTOR")? contentSearch Unsupported("tsvector")? @default(dbgenerated())
@@index([contentSearch]) @@index([contentSearch], type: Gin)
@@index([lastSeenAt, id]) @@index([lastSeenAt, id])
@@index([upvotes, id]) @@index([upvotes, id])
} }

Loading…
Cancel
Save