Skip to content

Commit

Permalink
Make audit columns not always default to app startup time (#1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewNewland authored Jun 30, 2023
1 parent e5f2b64 commit ec06e9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litestar/contrib/sqlalchemy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ class AuditColumns:

created_at: Mapped[datetime] = mapped_column( # pyright: ignore
DateTimeUTC(timezone=True),
default=datetime.now(timezone.utc),
default=lambda: datetime.now(timezone.utc),
)
"""Date/time of instance creation."""
updated_at: Mapped[datetime] = mapped_column( # pyright: ignore
DateTimeUTC(timezone=True),
default=datetime.now(timezone.utc),
default=lambda: datetime.now(timezone.utc),
)
"""Date/time of instance last update."""

Expand Down

0 comments on commit ec06e9a

Please sign in to comment.