File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """
2+ Order model
3+ """
4+
15from sqlalchemy import VARCHAR , Numeric , ForeignKey
26from sqlalchemy .dialects .postgresql import UUID
37from sqlalchemy .orm import Mapped , mapped_column
@@ -12,15 +16,17 @@ class Order(BaseModel):
1216 Attributes:
1317 - user_id (UUID): The unique identifier of the user who placed the order.
1418 Acts as both a primary key and a foreign key referencing the "user" table.
15- - price (float): The price of the order, stored with a precision of up to 10 digits and 2 decimal places.
19+ - price (float): The price of the order,
20+ stored with a precision of up to 10 digits and 2 decimal places.
1621 - token (str): The token associated with the order.
1722 - position (UUID): The identifier of the position related to the order.
1823
1924 Table:
2025 - Name: "order"
2126 """
2227 __tablename__ = "order"
23- user_id : Mapped [UUID ] = mapped_column (UUID (as_uuid = True ), ForeignKey ("user.id" ), primary_key = True )
28+ user_id : Mapped [UUID ] = mapped_column (UUID (as_uuid = True ),
29+ ForeignKey ("user.id" ), primary_key = True )
2430 price : Mapped [float ] = mapped_column (Numeric (precision = 10 , scale = 2 ))
2531 token : Mapped [str ] = mapped_column (VARCHAR )
2632 position : Mapped [UUID ] = mapped_column (UUID (as_uuid = True ))
You can’t perform that action at this time.
0 commit comments