Explain the "why"

Tables with original data keep their IDs,
and the ones `velofy` fills get them from the database.
This commit is contained in:
Alexander Hess 2026-12-04 10:49:18 +01:00
commit 245c123624
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
10 changed files with 10 additions and 10 deletions

View file

@ -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,

View file

@ -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),

View file

@ -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,

View file

@ -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:

View file

@ -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,

View file

@ -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,

View file

@ -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",

View file

@ -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,

View file

@ -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,

View file

@ -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,