chore: snapshot workflow migration progress

This commit is contained in:
2026-04-12 11:49:04 +02:00
parent 0cd02513d5
commit 3e810c74a3
163 changed files with 31774 additions and 2753 deletions
+9 -4
View File
@@ -5,7 +5,7 @@ to create notification rows in the audit_log table.
"""
import logging
import uuid
from datetime import datetime
from datetime import datetime, timezone
from sqlalchemy import create_engine, select
from sqlalchemy.orm import Session
@@ -23,6 +23,11 @@ CHANNEL_ALERT = "alert" # admin-only infrastructure issues
_engine = None
def _utcnow_naive() -> datetime:
"""Return UTC as a naive datetime for legacy TIMESTAMP WITHOUT TIME ZONE columns."""
return datetime.now(timezone.utc).replace(tzinfo=None)
def _get_engine():
global _engine
if _engine is None:
@@ -53,7 +58,7 @@ async def emit_notification(
details=details,
notification=True,
channel=channel,
timestamp=datetime.utcnow(),
timestamp=_utcnow_naive(),
)
db.add(entry)
await db.commit()
@@ -85,7 +90,7 @@ def emit_notification_sync(
details=details,
notification=True,
channel=channel,
timestamp=datetime.utcnow(),
timestamp=_utcnow_naive(),
)
session.add(entry)
session.commit()
@@ -149,7 +154,7 @@ def emit_batch_render_notification_sync(order_id: str) -> None:
},
notification=True,
channel=CHANNEL_NOTIFICATION,
timestamp=datetime.utcnow(),
timestamp=_utcnow_naive(),
)
session.add(entry)
session.commit()