Jun 30 - Add chat to AI analysis result (content from raw data)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user