Skip to content

Commit 450049d

Browse files
authored
Add Inventory model to manage product quantities
1 parent 0fa4cbf commit 450049d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,11 @@ class Shipment(Base):
8585
status = Column(String, nullable=False)
8686
created_at = Column(DateTime(timezone=True), server_default=func.now())
8787
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
88+
class Inventory(Base):
89+
__tablename__ = "inventory"
90+
id = Column(Integer, primary_key=True, index=True)
91+
product_id = Column(Integer, nullable=False)
92+
quantity_available = Column(Integer, nullable=False)
93+
last_updated = Column(DateTime(timezone=True), onupdate=func.now(), server_default=func.now())
94+
created_at = Column(DateTime(timezone=True), server_default=func.now())
95+

0 commit comments

Comments
 (0)