From 245c1236240601d19a5980e6e0d49dd4eeed6360 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Fri, 4 Dec 2026 10:49:18 +0100 Subject: [PATCH] Explain the "why" Tables with original data keep their IDs, and the ones `velofy` fills get them from the database. --- src/velofy/db/addresses.py | 2 +- src/velofy/db/cities.py | 2 +- src/velofy/db/couriers.py | 2 +- src/velofy/db/customers.py | 2 +- src/velofy/db/forecasts.py | 2 +- src/velofy/db/grids.py | 2 +- src/velofy/db/orders.py | 2 +- src/velofy/db/pixels.py | 2 +- src/velofy/db/replay/simulations.py | 2 +- src/velofy/db/restaurants.py | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/velofy/db/addresses.py b/src/velofy/db/addresses.py index e53d4d2..eab1034 100644 --- a/src/velofy/db/addresses.py +++ b/src/velofy/db/addresses.py @@ -25,7 +25,7 @@ class Address(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.Integer, primary_key=True, - autoincrement=False, + autoincrement=False, # because the IDs come from the original data ) primary_id: orm.Mapped[int] = orm.mapped_column( sa.Integer, diff --git a/src/velofy/db/cities.py b/src/velofy/db/cities.py index 930701d..c72222f 100644 --- a/src/velofy/db/cities.py +++ b/src/velofy/db/cities.py @@ -23,7 +23,7 @@ class City(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.SmallInteger, primary_key=True, - autoincrement=False, + autoincrement=False, # because the IDs come from the original data ) name: orm.Mapped[str] = orm.mapped_column( sa.Unicode(length=10), diff --git a/src/velofy/db/couriers.py b/src/velofy/db/couriers.py index bf5e576..9388576 100644 --- a/src/velofy/db/couriers.py +++ b/src/velofy/db/couriers.py @@ -19,7 +19,7 @@ class Courier(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.Integer, primary_key=True, - autoincrement=False, + autoincrement=False, # because the IDs come from the original data ) created_at: orm.Mapped[dt.datetime] = orm.mapped_column( sa.DateTime, diff --git a/src/velofy/db/customers.py b/src/velofy/db/customers.py index a8446bb..50deabb 100644 --- a/src/velofy/db/customers.py +++ b/src/velofy/db/customers.py @@ -20,7 +20,7 @@ class Customer(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.Integer, primary_key=True, - autoincrement=False, + autoincrement=False, # because the IDs come from the original data ) def __repr__(self) -> str: diff --git a/src/velofy/db/forecasts.py b/src/velofy/db/forecasts.py index 8ec96b1..cdd0490 100644 --- a/src/velofy/db/forecasts.py +++ b/src/velofy/db/forecasts.py @@ -26,7 +26,7 @@ class Forecast(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.Integer, primary_key=True, - autoincrement=True, + autoincrement=True, # because `velofy` creates the rows ) pixel_id: orm.Mapped[int] = orm.mapped_column( sa.Integer, diff --git a/src/velofy/db/grids.py b/src/velofy/db/grids.py index 2a570fe..ed2bcc8 100644 --- a/src/velofy/db/grids.py +++ b/src/velofy/db/grids.py @@ -23,7 +23,7 @@ class Grid(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.SmallInteger, primary_key=True, - autoincrement=True, + autoincrement=True, # because `velofy` creates the rows ) city_id: orm.Mapped[int] = orm.mapped_column( sa.SmallInteger, diff --git a/src/velofy/db/orders.py b/src/velofy/db/orders.py index 6810c10..74ed01d 100644 --- a/src/velofy/db/orders.py +++ b/src/velofy/db/orders.py @@ -21,7 +21,7 @@ class Order(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.Integer, primary_key=True, - autoincrement=False, + autoincrement=False, # because the IDs come from the original data ) _delivery_id: orm.Mapped[int | None] = orm.mapped_column( "delivery_id", diff --git a/src/velofy/db/pixels.py b/src/velofy/db/pixels.py index 77ae5fb..8d3df89 100644 --- a/src/velofy/db/pixels.py +++ b/src/velofy/db/pixels.py @@ -29,7 +29,7 @@ class Pixel(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.Integer, primary_key=True, - autoincrement=True, + autoincrement=True, # because `velofy` creates the rows ) grid_id: orm.Mapped[int] = orm.mapped_column( sa.SmallInteger, diff --git a/src/velofy/db/replay/simulations.py b/src/velofy/db/replay/simulations.py index 4752f7a..9ccf0c9 100644 --- a/src/velofy/db/replay/simulations.py +++ b/src/velofy/db/replay/simulations.py @@ -19,7 +19,7 @@ class ReplaySimulation(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.Integer, primary_key=True, - autoincrement=True, + autoincrement=True, # because `velofy` creates the rows ) city_id: orm.Mapped[int] = orm.mapped_column( sa.SmallInteger, diff --git a/src/velofy/db/restaurants.py b/src/velofy/db/restaurants.py index 916013b..70c9663 100644 --- a/src/velofy/db/restaurants.py +++ b/src/velofy/db/restaurants.py @@ -26,7 +26,7 @@ class Restaurant(meta.Base): id: orm.Mapped[int] = orm.mapped_column( sa.SmallInteger, primary_key=True, - autoincrement=False, + autoincrement=False, # because the IDs come from the original data ) created_at: orm.Mapped[dt.datetime] = orm.mapped_column( sa.DateTime,