From 7bbedd93cf078fc7496a6779cf9eda6e588e64c0 Mon Sep 17 00:00:00 2001
From: Grail Finder <wohilas@gmail.com>
Date: Tue, 7 Jan 2025 11:11:44 +0300
Subject: Enha (RAG): raw text as primary key in vector db

---
 storage/migrations/002_add_vector.up.sql | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'storage/migrations/002_add_vector.up.sql')

diff --git a/storage/migrations/002_add_vector.up.sql b/storage/migrations/002_add_vector.up.sql
index f64aecb..6c8fb52 100644
--- a/storage/migrations/002_add_vector.up.sql
+++ b/storage/migrations/002_add_vector.up.sql
@@ -1,13 +1,11 @@
 CREATE VIRTUAL TABLE IF NOT EXISTS embeddings USING vec0(
-    id INTEGER PRIMARY KEY AUTOINCREMENT,
     embedding FLOAT[5120],
     slug TEXT NOT NULL,
-    raw_text TEXT NOT NULL
+    raw_text TEXT PRIMARY KEY,
 );
 
 CREATE VIRTUAL TABLE IF NOT EXISTS embeddings_384 USING vec0(
-    id INTEGER PRIMARY KEY AUTOINCREMENT,
     embedding FLOAT[384],
     slug TEXT NOT NULL,
-    raw_text TEXT NOT NULL
+    raw_text TEXT PRIMARY KEY
 );
-- 
cgit v1.2.3

