mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-02-08 04:57:34 +08:00
WIP: [questions][fix] workaround for prisma bug
This commit is contained in:
@@ -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[]
|
||||
answers QuestionsAnswer[]
|
||||
|
||||
contentSearch Unsupported("TSVECTOR")?
|
||||
contentSearch Unsupported("tsvector")? @default(dbgenerated())
|
||||
|
||||
@@index([contentSearch])
|
||||
@@index([contentSearch], type: Gin)
|
||||
@@index([lastSeenAt, id])
|
||||
@@index([upvotes, id])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user