DB-Migrationen (status_history, category) + Claude CLI stdin-Übergabe

- status_history Spalte für fact_checks (Faktencheck-Verlauf als JSON)
- category Spalte für article_locations (Marker-Klassifizierung)
- Prompt-Übergabe an Claude CLI via stdin statt Argument (ARG_MAX)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
claude-dev
2026-03-08 13:25:21 +01:00
Ursprung bcad3e9f3c
Commit 2dd11c9db7
2 geänderte Dateien mit 29 neuen und 4 gelöschten Zeilen

Datei anzeigen

@@ -350,6 +350,26 @@ async def init_db():
await db.execute("ALTER TABLE fact_checks ADD COLUMN tenant_id INTEGER REFERENCES organizations(id)")
await db.commit()
# Migration: status_history fuer fact_checks (Faktencheck-Verlauf)
if "status_history" not in fc_columns:
await db.execute("ALTER TABLE fact_checks ADD COLUMN status_history TEXT DEFAULT '[]'")
# Bestehende Eintraege initialisieren
cursor2 = await db.execute("SELECT id, status, checked_at FROM fact_checks")
for row2 in await cursor2.fetchall():
import json as _json
initial_history = _json.dumps([{"status": row2[1], "at": str(row2[2])}])
await db.execute("UPDATE fact_checks SET status_history = ? WHERE id = ?", (initial_history, row2[0]))
await db.commit()
logger.info("Migration: status_history zu fact_checks hinzugefuegt")
# Migration: category fuer article_locations (Marker-Klassifizierung)
cursor = await db.execute("PRAGMA table_info(article_locations)")
al_columns = [row[1] for row in await cursor.fetchall()]
if "category" not in al_columns:
await db.execute("ALTER TABLE article_locations ADD COLUMN category TEXT DEFAULT 'mentioned'")
await db.commit()
logger.info("Migration: category zu article_locations hinzugefuegt")
# Migration: tenant_id fuer incident_snapshots
cursor = await db.execute("PRAGMA table_info(incident_snapshots)")
snap_columns2 = [row[1] for row in await cursor.fetchall()]