-
Notifications
You must be signed in to change notification settings - Fork 180
Remove inline ALTER TABLE from postgres_search_repository #727
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
PR #723 added inline ALTER TABLE statements in postgres_search_repository.py (lines ~324-360) that run at runtime during every vector sync initialization. These add entity_fingerprint and embedding_model columns to search_vector_chunks.
This causes deadlocks when two concurrent index jobs hit the same database — both try to ALTER TABLE simultaneously and Postgres detects the deadlock.
The alembic migration for these columns already exists: m6h7i8j9k0l1_add_vector_sync_fingerprints.py
Fix
Delete the inline DDL from postgres_search_repository.py. The alembic migration handles schema changes. Runtime code should never run ALTER TABLE.
File
src/basic_memory/repository/postgres_search_repository.py — remove the ALTER TABLE / ADD COLUMN IF NOT EXISTS block
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working