Fix: commit missing init_db migration for sync_lookback_days column
This ALTER TABLE was written locally but never staged, so the production image ran without it and the column was never added to the DB. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user