fix: Add missing columns to daily_workflow_plans table

- Added generation_mode column (VARCHAR, default: 'llm_generation')
- Added committee_agent_count column (INTEGER, default: 0)
- Added fallback_used column (BOOLEAN, default: 0)

Also fixed:
- Imported daily_workflow_models in services/database.py to ensure models are registered
- Added _create_daily_workflow_tables() to database setup
- Created migration script to add columns to 35 existing databases
- Fixed WorkflowError type in frontend to use constructor for proper 'name' property

This resolves the 'no such column' sqlite3 errors when accessing the today-workflow API.
This commit is contained in:
ajaysi
2026-03-09 12:48:12 +05:30
parent 7747174f00
commit 9713af0c1b
8 changed files with 537 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ class DatabaseSetup:
self._create_subscription_tables()
self._create_persona_tables()
self._create_onboarding_tables()
self._create_daily_workflow_tables()
if verbose:
print("✅ Essential database tables created")
@@ -114,6 +115,22 @@ class DatabaseSetup:
print(f" ⚠️ Onboarding tables failed: {e}")
return True # Non-critical
def _create_daily_workflow_tables(self) -> bool:
"""Create daily workflow tables."""
import os
verbose = os.getenv("ALWRITY_VERBOSE", "false").lower() == "true"
try:
from models.enhanced_strategy_models import Base as StrategyBase
StrategyBase.metadata.create_all(bind=engine)
if verbose:
print(" ✅ Daily workflow tables created")
return True
except Exception as e:
if verbose:
print(f" ⚠️ Daily workflow tables failed: {e}")
return True # Non-critical
def verify_tables(self) -> bool:
"""Verify that essential tables exist."""
import os