From bf2749cf61a4dc16371eaefe5a8685bdcd679eff Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Fri, 4 Dec 2026 12:48:29 +0100 Subject: [PATCH] Explain the "why" --- src/velofy/db/addresses.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/velofy/db/addresses.py b/src/velofy/db/addresses.py index 500619f..2c26fe8 100644 --- a/src/velofy/db/addresses.py +++ b/src/velofy/db/addresses.py @@ -96,7 +96,8 @@ class Address(meta.Base): "-180 <= longitude AND longitude <= 180", name="longitude_between_180_degrees", ), - # Needed by a `ForeignKeyConstraint` in `AddressPixelAssociation` + # The foreign key in `AddressPixelAssociation` refers to this pair + # => An `Address` can only be in `Pixel`s of its own `.city` sa.UniqueConstraint("id", "city_id"), # Covers the zip codes of the target cities Bordeaux, Lyon, and Paris sa.CheckConstraint(