From 425565b639236793b7b1a9a124e34732e25c72ae Mon Sep 17 00:00:00 2001 From: yann Date: Mon, 25 Aug 2025 16:21:29 +0200 Subject: [PATCH] fix test sqlite iso issue on date --- models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/models.py b/models.py index c6a1000..4f372d1 100644 --- a/models.py +++ b/models.py @@ -59,8 +59,10 @@ class Customer(Base): email: Mapped[str] = mapped_column(String(20)) phone: Mapped[int] = mapped_column(Integer) company: Mapped[str] = mapped_column(String(40)) - creation_date: Mapped[date] = mapped_column(Date, - server_default=func.now()) + creation_date: Mapped[date] = mapped_column(DateTime, + default=datetime.now()) + # creation_date: Mapped[date] = mapped_column(Date, + # server_default=func.now()) last_update: Mapped[Optional[datetime]] = mapped_column(DateTime) commercial_id: Mapped[Optional[int]] = mapped_column( ForeignKey("collaborator.id")) @@ -82,6 +84,8 @@ class Contract(Base): id: Mapped[int] = mapped_column(primary_key=True) signed: Mapped[bool] = mapped_column(Boolean, default=False) + # creation_date: Mapped[date] = mapped_column(Date, + # server_default=func.now()) creation_date: Mapped[date] = mapped_column(Date, server_default=func.now()) amount: Mapped[int] = mapped_column(Integer)