Commit 9acd2a6
fix: preserve search index across server restarts
Remove unconditional DROP TABLE from init_search_index() that was wiping
the FTS5 search index on every MCP server startup.
The bug was introduced in PR #439 (v0.16.3) when splitting SQLite and
Postgres search implementations. The DROP TABLE was added with a comment
about Base.metadata.create_all() potentially creating a regular table,
but this caused all indexed data to be lost whenever Claude Desktop
restarted the MCP server.
Symptoms users experienced:
- Notes searchable immediately after creation
- Search returns empty results after ~30 minutes (server restart)
- Files exist on disk but search index is empty
- recent_activity() shows "No recent activity"
The fix simply removes the DROP TABLE since CREATE_SEARCH_INDEX already
uses "CREATE VIRTUAL TABLE IF NOT EXISTS" which safely handles both
cases (table exists vs doesn't exist).
Affected users should run `basic-memory reset` once after updating to
rebuild their search index.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 5947f04 commit 9acd2a6
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
| |||
0 commit comments