From 648035b194dd1b8c658a6411b9f9fe19467ccc10 Mon Sep 17 00:00:00 2001
From: Grail Finder <wohilas@gmail.com>
Date: Fri, 13 Mar 2026 10:18:31 +0300
Subject: Fix: slow startup from silly migrations

---
 storage/migrations/004_populate_fts.up.sql | 30 ++++--------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

(limited to 'storage/migrations/004_populate_fts.up.sql')

diff --git a/storage/migrations/004_populate_fts.up.sql b/storage/migrations/004_populate_fts.up.sql
index 1d1b16a..1068bf7 100644
--- a/storage/migrations/004_populate_fts.up.sql
+++ b/storage/migrations/004_populate_fts.up.sql
@@ -1,26 +1,4 @@
--- Populate FTS table with existing embeddings
-DELETE FROM fts_embeddings;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 384 FROM embeddings_384;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 768 FROM embeddings_768;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 1024 FROM embeddings_1024;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 1536 FROM embeddings_1536;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 2048 FROM embeddings_2048;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 3072 FROM embeddings_3072;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 4096 FROM embeddings_4096;
-
-INSERT INTO fts_embeddings (slug, raw_text, filename, embedding_size)
-SELECT slug, raw_text, filename, 5120 FROM embeddings_5120;
\ No newline at end of file
+-- Populate FTS table with existing embeddings (incremental - only inserts missing rows)
+-- Only use 768 embeddings as that's what we use
+INSERT OR IGNORE INTO fts_embeddings (slug, raw_text, filename, embedding_size)
+SELECT slug, raw_text, filename, 768 FROM embeddings_768;
\ No newline at end of file
-- 
cgit v1.2.3

