Add reusable LLM parser profiles with multi-event extract.
Support kind=llm profiles (instruction/schema), optional multi-event posts via #eN URLs, and recover stale running/queued parse jobs after worker crashes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,11 +23,14 @@ def migrate_schema(engine: Engine) -> None:
|
||||
if "channel_id" not in columns:
|
||||
statements.append("ALTER TABLE parse_jobs ADD COLUMN channel_id INTEGER")
|
||||
|
||||
# create_all handles new tables; FKs on existing DBs may need indexes
|
||||
if "parse_jobs" in tables:
|
||||
# Re-inspect after potential adds is not needed for FK constraints here —
|
||||
# create_all + nullable FKs are enough for MVP; optional constraints below.
|
||||
pass
|
||||
if "parser_profiles" in tables:
|
||||
columns = {col["name"] for col in inspector.get_columns("parser_profiles")}
|
||||
if "kind" not in columns:
|
||||
statements.append(
|
||||
"ALTER TABLE parser_profiles ADD COLUMN kind VARCHAR(50) NOT NULL DEFAULT 'heuristic'"
|
||||
)
|
||||
if "llm_profile" not in columns:
|
||||
statements.append("ALTER TABLE parser_profiles ADD COLUMN llm_profile JSON")
|
||||
|
||||
if not statements:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user