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:
parent
07440785ab
commit
245c123624
10 changed files with 10 additions and 10 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue