remove conflict constraint name from relation_repository.py

Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
phernandez
2025-11-30 19:30:54 -06:00
parent 0818bda565
commit 0eaf30bb06
6 changed files with 14 additions and 18 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ def parse_inline_relations(content: str) -> List[Dict[str, Any]]:
target = content[start + 2 : end].strip()
if target:
relations.append({"type": "links to", "target": target, "context": None})
relations.append({"type": "links_to", "target": target, "context": None})
start = end + 2
@@ -132,15 +132,11 @@ class RelationRepository(Repository[Relation]):
if dialect_name == "postgresql":
stmt = pg_insert(Relation).values(values)
stmt = stmt.on_conflict_do_nothing(
index_elements=["from_id", "to_name", "relation_type"]
)
stmt = stmt.on_conflict_do_nothing()
else:
# SQLite
stmt = sqlite_insert(Relation).values(values)
stmt = stmt.on_conflict_do_nothing(
index_elements=["from_id", "to_name", "relation_type"]
)
stmt = stmt.on_conflict_do_nothing()
result = await session.execute(stmt)
return result.rowcount if result.rowcount else 0