use uniqueness for complete db check
Some checks failed
Mypy / mypy (push) Failing after 1m11s
Pytest / pytest (3.12) (push) Failing after 1m14s
Pytest / pytest (3.13) (push) Failing after 1m8s
Pytest / pytest (3.14) (push) Failing after 1m9s
Ruff / ruff (push) Failing after 59s

This commit is contained in:
Justus Kuhlmann 2026-04-14 16:42:39 +02:00
commit 85698c377b
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -26,6 +26,10 @@ def are_keys_unique(db: Path, table: str, col: str) -> bool:
def check_db_integrity(path: Path) -> None: def check_db_integrity(path: Path) -> None:
db = get_db_file(path) db = get_db_file(path)
if not are_keys_unique(db, 'backlogs', 'path'):
raise Exception("The paths the backlog table of the database links are not unique.")
search_expr = "SELECT * FROM 'backlogs'" search_expr = "SELECT * FROM 'backlogs'"
conn = sqlite3.connect(db) conn = sqlite3.connect(db)
results = pd.read_sql(search_expr, conn) results = pd.read_sql(search_expr, conn)