File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -350,7 +350,10 @@ async def run_migrations(
350350 # For SQLite: Create FTS5 virtual table
351351 # For Postgres: No-op (tsvector column added by migrations)
352352 # The project_id is not used for init_search_index, so we pass a dummy value
353- if database_type == DatabaseType .POSTGRES or app_config .database_backend == DatabaseBackend .POSTGRES :
353+ if (
354+ database_type == DatabaseType .POSTGRES
355+ or app_config .database_backend == DatabaseBackend .POSTGRES
356+ ):
354357 await PostgresSearchRepository (session_maker , 1 ).init_search_index ()
355358 else :
356359 await SQLiteSearchRepository (session_maker , 1 ).init_search_index ()
Original file line number Diff line number Diff line change @@ -448,8 +448,11 @@ async def update_entity_relations(
448448 import asyncio
449449
450450 # Create tasks for all relation lookups
451+ # Use strict=True to disable fuzzy search - only exact matches should create resolved relations
452+ # This ensures forward references (links to non-existent entities) remain unresolved (to_id=NULL)
451453 lookup_tasks = [
452- self .link_resolver .resolve_link (rel .target ) for rel in markdown .relations
454+ self .link_resolver .resolve_link (rel .target , strict = True )
455+ for rel in markdown .relations
453456 ]
454457
455458 # Execute all lookups in parallel
You can’t perform that action at this time.
0 commit comments