Phase 5: Remove cross-domain FKs and relationships from calendar models
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 48s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 48s
- CalendarEntry.order_id: plain Integer column (no FK to orders) - CalendarEntry: remove order relationship - Ticket.order_id: plain Integer column (no FK to orders) - Ticket: remove order relationship Cross-domain bridging now handled by glue services. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,7 +80,7 @@ class CalendarEntry(Base):
|
||||
# NEW: ownership + order link
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=True, index=True)
|
||||
session_id = Column(String(64), nullable=True, index=True)
|
||||
order_id = Column(Integer, ForeignKey("orders.id", ondelete="SET NULL"), nullable=True, index=True)
|
||||
order_id = Column(Integer, nullable=True, index=True)
|
||||
|
||||
# NEW: slot link
|
||||
slot_id = Column(Integer, ForeignKey("calendar_slots.id", ondelete="SET NULL"), nullable=True, index=True)
|
||||
@@ -122,8 +122,6 @@ class CalendarEntry(Base):
|
||||
|
||||
calendar = relationship("Calendar", back_populates="entries")
|
||||
slot = relationship("CalendarSlot", back_populates="entries", lazy="selectin")
|
||||
# Optional, but handy:
|
||||
order = relationship("Order", back_populates="calendar_entries", lazy="selectin")
|
||||
posts = relationship("CalendarEntryPost", back_populates="entry", cascade="all, delete-orphan")
|
||||
ticket_types = relationship(
|
||||
"TicketType",
|
||||
@@ -249,12 +247,7 @@ class Ticket(Base):
|
||||
)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=True, index=True)
|
||||
session_id = Column(String(64), nullable=True, index=True)
|
||||
order_id = Column(
|
||||
Integer,
|
||||
ForeignKey("orders.id", ondelete="SET NULL"),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
order_id = Column(Integer, nullable=True, index=True)
|
||||
|
||||
code = Column(String(64), unique=True, nullable=False) # QR/barcode value
|
||||
state = Column(
|
||||
@@ -278,7 +271,6 @@ class Ticket(Base):
|
||||
|
||||
entry = relationship("CalendarEntry", backref="tickets")
|
||||
ticket_type = relationship("TicketType", backref="tickets")
|
||||
order = relationship("Order", backref="tickets")
|
||||
|
||||
|
||||
class CalendarEntryPost(Base):
|
||||
|
||||
Reference in New Issue
Block a user