Readded fk constraint for conversion_guests
This commit is contained in:
@@ -622,12 +622,15 @@ class Conversion(Base):
|
||||
updated_at = Column(DateTime(timezone=True)) # When this record was last updated
|
||||
|
||||
# Table constraints
|
||||
# Note: The relationship to ConversionGuest is handled via SQLAlchemy ORM
|
||||
# by matching (hotel_id, guest_id) pairs, no DB-level FK constraint needed
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"hotel_id", "pms_reservation_id", name="uq_conversion_hotel_reservation"
|
||||
),
|
||||
ForeignKeyConstraint(
|
||||
["hotel_id", "guest_id"],
|
||||
["conversion_guests.hotel_id", "conversion_guests.guest_id"],
|
||||
name="fk_conversions_guest",
|
||||
),
|
||||
)
|
||||
|
||||
# Relationships
|
||||
|
||||
Reference in New Issue
Block a user