many updates

This commit is contained in:
2026-01-13 09:42:16 -08:00
parent 4bb86b603e
commit 362f4cb5aa
81 changed files with 3106 additions and 336 deletions

View File

@@ -0,0 +1,18 @@
from src.services.postgresql_manager import PostgreSQLManager
from src.utils.config import config
from src.models.activity import Activity
from sqlalchemy import text
def backfill():
print("Backfilling is_estimated_power defaults...")
db_manager = PostgreSQLManager(config.DATABASE_URL)
with db_manager.get_db_session() as session:
# Update all NULLs to False
result = session.execute(
text("UPDATE activities SET is_estimated_power = false WHERE is_estimated_power IS NULL")
)
session.commit()
print(f"Updated {result.rowcount} rows.")
if __name__ == "__main__":
backfill()