feat: per-page SumUp models and migration (Phase 3)

- Migration: add market_place_id to cart_items, page_config_id to orders
- Order model: add page_config_id FK and page_config relationship
- CartItem model: add market_place_id FK and market_place relationship

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-10 20:49:55 +00:00
parent a420bfa7f0
commit 123f752946
3 changed files with 77 additions and 1 deletions

View File

@@ -17,6 +17,12 @@ class Order(Base):
user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("users.id"), nullable=True)
session_id: Mapped[Optional[str]] = mapped_column(String(64), index=True, nullable=True)
page_config_id: Mapped[Optional[int]] = mapped_column(
ForeignKey("page_configs.id", ondelete="SET NULL"),
nullable=True,
index=True,
)
status: Mapped[str] = mapped_column(
String(32),
nullable=False,
@@ -68,6 +74,11 @@ class Order(Base):
back_populates="order",
lazy="selectin",
)
page_config: Mapped[Optional["PageConfig"]] = relationship(
"PageConfig",
foreign_keys=[page_config_id],
lazy="selectin",
)
class OrderItem(Base):