You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous fix issued an unconditional
`DELETE FROM search_vector_embeddings WHERE rowid IN (...)` during project
deletion, which 500'd on Postgres:
column "rowid" does not exist
Postgres uses `chunk_id` (a real column with an FK to
search_vector_chunks.id ON DELETE CASCADE), so it doesn't need or accept
the SQLite query at all. The cascade picture by backend:
- search_index → project: Postgres has FK CASCADE; SQLite FTS5 virtual
table can't carry FKs and needs explicit cleanup.
- search_vector_chunks → project: neither backend has an FK, so both
need an explicit DELETE.
- search_vector_embeddings → search_vector_chunks: Postgres has FK
CASCADE on chunk_id; SQLite vec0 virtual table is keyed by rowid
with no cascade, so embeddings must be purged before the chunks.
Branch is now: chunks DELETE runs on both backends; search_index and
the vec0 embeddings DELETE only run on SQLite.
Verified locally against both backends (SQLite: 31 passed, Postgres
via testcontainers: 26 passed) for tests/services/test_project_removal_bug.py
and the CLI/MCP project-management integration suites.
Signed-off-by: phernandez <paul@basicmachines.co>
0 commit comments