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

@@ -413,13 +413,23 @@ class CartItem(Base):
nullable=False,
server_default=func.now(),
)
market_place_id: Mapped[int | None] = mapped_column(
ForeignKey("market_places.id", ondelete="SET NULL"),
nullable=True,
index=True,
)
deleted_at: Mapped[datetime | None] = mapped_column(
DateTime(timezone=True),
nullable=True,
)
# Relationships
market_place: Mapped["MarketPlace | None"] = relationship(
"MarketPlace",
foreign_keys=[market_place_id],
)
product: Mapped["Product"] = relationship(
"Product",
back_populates="cart_items",