From f2df8af4c836683fc91aa1e10cf0954b04789814 Mon Sep 17 00:00:00 2001 From: Charles Yao Date: Sun, 23 Nov 2025 23:00:10 -0600 Subject: [PATCH] ECO-171: update to use server default time stamp --- api/models/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/models/tools.py b/api/models/tools.py index 2af592cd30..6b84d3dd9b 100644 --- a/api/models/tools.py +++ b/api/models/tools.py @@ -138,12 +138,12 @@ class EndUserAuthenticationProvider(TypeBase): # encrypted credentials for the end user encrypted_credentials: Mapped[str] = mapped_column(LongText, nullable=False, default="") created_at: Mapped[datetime] = mapped_column( - sa.DateTime, nullable=False, default=datetime.now, init=False + sa.DateTime, nullable=False, server_default=func.current_timestamp(), init=False ) updated_at: Mapped[datetime] = mapped_column( sa.DateTime, nullable=False, - default=datetime.now, + server_default=func.current_timestamp(), onupdate=func.current_timestamp(), init=False, )