Fix a few sql gotchas
This commit is contained in:
@@ -24,6 +24,7 @@ class _CustomData(ModelBase):
|
|||||||
- One metadata entry can only be associated with one Trade
|
- One metadata entry can only be associated with one Trade
|
||||||
"""
|
"""
|
||||||
__tablename__ = 'trade_custom_data'
|
__tablename__ = 'trade_custom_data'
|
||||||
|
__allow_unmapped__ = True
|
||||||
session: ClassVar[SessionType]
|
session: ClassVar[SessionType]
|
||||||
|
|
||||||
# Uniqueness should be ensured over pair, order_id
|
# Uniqueness should be ensured over pair, order_id
|
||||||
|
|||||||
@@ -1485,7 +1485,7 @@ class Trade(ModelBase, LocalTrade):
|
|||||||
"Order", order_by="Order.id", cascade="all, delete-orphan", lazy="selectin",
|
"Order", order_by="Order.id", cascade="all, delete-orphan", lazy="selectin",
|
||||||
innerjoin=True) # type: ignore
|
innerjoin=True) # type: ignore
|
||||||
custom_data: Mapped[List[_CustomData]] = relationship(
|
custom_data: Mapped[List[_CustomData]] = relationship(
|
||||||
"CustomData", order_by="CustomData.id", cascade="all, delete-orphan",
|
"_CustomData", cascade="all, delete-orphan",
|
||||||
lazy="raise") # type: ignore
|
lazy="raise") # type: ignore
|
||||||
|
|
||||||
exchange: Mapped[str] = mapped_column(String(25), nullable=False) # type: ignore
|
exchange: Mapped[str] = mapped_column(String(25), nullable=False) # type: ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user