Revert "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 4s

This reverts commit e09ea3a145.
This commit is contained in:
Antigravity
2026-05-12 09:19:01 +00:00
parent e09ea3a145
commit 4c1359ee39
10 changed files with 27 additions and 105 deletions

View File

@@ -1,7 +1,7 @@
-- Phase 1: Enable pgvector extension
CREATE EXTENSION IF NOT EXISTS vector;
-- Phase 2: Convert embedding column from text to vector(2560)
-- Phase 2: Convert embedding column from text to vector(1536)
-- 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(2560)
USING "embedding"::vector(2560);
ALTER COLUMN "embedding" TYPE vector(1536)
USING "embedding"::vector(1536);
RETURN;
END IF;

View File

@@ -300,7 +300,7 @@ model UserAISettings {
model NoteEmbedding {
id String @id @default(cuid())
noteId String @unique
embedding Unsupported("vector(2560)")
embedding Unsupported("vector(1536)")
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
note Note @relation(fields: [noteId], references: [id], onDelete: Cascade)