diff --git a/photo_review/entity/zx_ie_cost.py b/photo_review/entity/zx_ie_cost.py index 3b994ad..04834b2 100644 --- a/photo_review/entity/zx_ie_cost.py +++ b/photo_review/entity/zx_ie_cost.py @@ -1,5 +1,5 @@ # coding: utf-8 -from sqlalchemy import Column, DECIMAL, Date, DateTime, String +from sqlalchemy import Column, DECIMAL, Date, DateTime, String, text from sqlalchemy.dialects.mysql import INTEGER from config.mysql import Base @@ -17,7 +17,7 @@ class ZxIeCost(Base): discharge_date = Column(Date, comment='出院日期') medical_expenses_str = Column(String(255), comment='费用总额字符串') medical_expenses = Column(DECIMAL(18, 2), comment='费用总额') - create_time = Column(DateTime, comment='创建时间') + create_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间') creator = Column(String(255), comment='创建人') - update_time = Column(DateTime, comment='修改时间') + update_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='修改时间') updater = Column(String(255), comment='修改人')