diff --git a/backend/app/main.py b/backend/app/main.py index c2f3933..a487efc 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -40,6 +40,16 @@ async def init_db(): except Exception as e: print(f"TimescaleDB hypertable skipped: {e}") + # Add columns that were introduced after initial table creation (non-fatal) + try: + async with engine.begin() as conn: + await conn.execute(text( + "ALTER TABLE garmin_connect_configs " + "ADD COLUMN IF NOT EXISTS sync_lookback_days INTEGER DEFAULT 30" + )) + except Exception as e: + print(f"Column migration skipped: {e}") + # Seed admin user (only if password is configured) if not settings.admin_password: print("ADMIN_PASSWORD not set - skipping admin user seed")