From e582e1e04a0cbc5d1f117a3e91e305f043022c3e Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Mon, 24 Jun 2024 11:10:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8zx=5Fie=5Fcost=5Fdet?= =?UTF-8?q?ail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/entity/zx_ie_cost_detail.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/photo_review/entity/zx_ie_cost_detail.py b/photo_review/entity/zx_ie_cost_detail.py index ea72fdc..e41aeda 100644 --- a/photo_review/entity/zx_ie_cost_detail.py +++ b/photo_review/entity/zx_ie_cost_detail.py @@ -1,5 +1,5 @@ # coding: utf-8 -from sqlalchemy import Column, DECIMAL, DateTime, String +from sqlalchemy import Column, DECIMAL, DateTime, String, text from sqlalchemy.dialects.mysql import INTEGER from config.mysql import Base @@ -17,7 +17,7 @@ class ZxIeCostDetail(Base): price = Column(DECIMAL(18, 2), comment='单价') quantity = Column(INTEGER(11), comment='数量') amount = Column(DECIMAL(18, 2), comment='金额(单价 * 数量)') - create_time = Column(DateTime, comment='创建时间') + create_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间') creator = Column(String(30), comment='创建人') - update_time = Column(DateTime, comment='修改时间') + update_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='修改时间') updater = Column(String(30), comment='修改人')