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='修改人')