fix: switch embedding dimension from 1536 to 2560 for qwen-embedding-4b
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 5s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 5s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
-- Phase 1: Enable pgvector extension
|
||||
CREATE EXTENSION IF NOT EXISTS vector;
|
||||
|
||||
-- Phase 2: Convert embedding column from text to vector(1536)
|
||||
-- Phase 2: Convert embedding column from text to vector(2560)
|
||||
-- Idempotent: detects current column type and only converts when needed.
|
||||
-- Handles all partial states from previous failed migration attempts:
|
||||
-- A) embedding is text → direct ALTER COLUMN TYPE conversion
|
||||
@@ -25,8 +25,8 @@ BEGIN
|
||||
IF _emb_type IS NOT NULL THEN
|
||||
ALTER TABLE "NoteEmbedding" DROP COLUMN IF EXISTS "_vec_tmp";
|
||||
ALTER TABLE "NoteEmbedding"
|
||||
ALTER COLUMN "embedding" TYPE vector(1536)
|
||||
USING "embedding"::vector(1536);
|
||||
ALTER COLUMN "embedding" TYPE vector(2560)
|
||||
USING "embedding"::vector(2560);
|
||||
RETURN;
|
||||
END IF;
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ model UserAISettings {
|
||||
model NoteEmbedding {
|
||||
id String @id @default(cuid())
|
||||
noteId String @unique
|
||||
embedding Unsupported("vector(1536)")
|
||||
embedding Unsupported("vector(2560)")
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
note Note @relation(fields: [noteId], references: [id], onDelete: Cascade)
|
||||
|
||||
Reference in New Issue
Block a user