Push geo-filter: Giftköder-Alert nur im 30km-Radius, Standort via Alerts-Check gespeichert

This commit is contained in:
rene 2026-04-24 09:35:55 +02:00
parent 9213b58d3c
commit b5e4eab84d
4 changed files with 44 additions and 5 deletions

View file

@ -1009,3 +1009,11 @@ def _migrate(conn_factory):
CREATE INDEX IF NOT EXISTS idx_wp_dog_week ON weekly_praise(dog_id, week_key DESC);
""")
logger.info("Migration: weekly_praise Tabelle bereit.")
# Push: Standort-Filter (last_lat/lon für geo-basierte Alerts)
for col in ["last_lat REAL", "last_lon REAL"]:
try:
conn.execute(f"ALTER TABLE push_subscriptions ADD COLUMN {col}")
except Exception:
pass
logger.info("Migration: push_subscriptions last_lat/lon bereit.")