Stelle bestehende Quellzuordnungen wieder her und halte Connectoren beim eigenen Konto.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d6b70d8f92
commit
c3a07cee64
8 files changed
+250
-9
No files matched your search
@@ -146,7 +146,15 @@ def attach_new_reference(conn, element_id: UUID) -> None:
|
||||
|
||||
|
||||
def backfill_source_bindings(conn) -> None:
|
||||
"""Idempotent. Bound and ambiguous rows stay. Unique unresolved stock is bound once."""
|
||||
"""Idempotent. Unique stock is bound once. A stored id is never retargeted.
|
||||
|
||||
Startup calls this before the application has imported the connector
|
||||
modules. Register them first, otherwise every existing reference stays
|
||||
unresolved and the case or matter can no longer open its originals.
|
||||
"""
|
||||
from app.sources import _install_sources
|
||||
|
||||
_install_sources()
|
||||
conn.execute(
|
||||
"""
|
||||
UPDATE external_references
|
||||
@@ -160,7 +168,7 @@ def backfill_source_bindings(conn) -> None:
|
||||
FROM external_references er
|
||||
JOIN elements e ON e.id = er.element_id
|
||||
WHERE er.source <> 'url'
|
||||
AND er.resolution = 'unresolved'
|
||||
AND er.resolution IN ('unresolved', 'ambiguous')
|
||||
AND er.connector_id IS NULL
|
||||
"""
|
||||
).fetchall()
|
||||
|
||||
Reference in new issue
Block a user