Skip to content

Commit

Permalink
Added event handler to DB model to set modified date on update
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcundill committed Feb 22, 2024
1 parent 3b881c1 commit 35107ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request_model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Request(Base):

id = Column(Integer, primary_key=True)
created = Column(DateTime(timezone=True), server_default=func.now())
modified = Column(DateTime(timezone=True), server_default=func.now())
modified = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
user_email = Column(String)
status = Column(String)
data = Column(JSON)
Expand Down

0 comments on commit 35107ba

Please sign in to comment.