Jun 30 - Add chat to AI analysis result (content from raw data)

This commit is contained in:
2026-06-30 11:45:22 -04:00
parent 5719bcf06e
commit c5078cc5f8
3 changed files with 41 additions and 11 deletions
+18
View File
@@ -409,6 +409,24 @@ def initialize_database():
conn.commit()
logger.info("Migration: added idx_activity_log_time index to activity_log.")
# ── ai_analysis_log: add document_text column if missing ──────────────
cursor.execute(
"""
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'ai_analysis_log'
AND COLUMN_NAME = 'document_text'
"""
)
(has_doc_text,) = cursor.fetchone()
if not has_doc_text:
cursor.execute(
"ALTER TABLE ai_analysis_log "
"ADD COLUMN document_text MEDIUMTEXT NULL AFTER criteria_snapshot"
)
conn.commit()
logger.info("Migration: added document_text column to ai_analysis_log.")
# ── Seed app_settings from environment variables (first-run bootstrap) ─
# Uses INSERT IGNORE so values already saved via the Admin UI are never
# overwritten — .env only fills in keys that are completely absent.