add updated_at fields
This commit is contained in:
@@ -40,6 +40,7 @@ class Shop(Base):
|
||||
city = Column(String, nullable=False)
|
||||
address = Column(String, nullable=True)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
# Relationships
|
||||
shopping_events = relationship("ShoppingEvent", back_populates="shop")
|
||||
@@ -53,6 +54,7 @@ class ShoppingEvent(Base):
|
||||
total_amount = Column(Float, nullable=True) # Total cost of the shopping event
|
||||
notes = Column(String, nullable=True)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
# Relationships
|
||||
shop = relationship("Shop", back_populates="shopping_events")
|
||||
|
||||
Reference in New Issue
Block a user