18 lines
852 B
Python
18 lines
852 B
Python
from datetime import datetime
|
|
from sqlalchemy import Column, Integer, String, Text, DateTime, ForeignKey
|
|
from ..database import Base
|
|
|
|
|
|
class Template(Base):
|
|
__tablename__ = "template"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
name = Column(String(200), nullable=False, comment="模板名称")
|
|
type = Column(String(50), default="report", comment="报告类/公文类/总结类/合同类")
|
|
version = Column(String(20), default="v1.0.0", comment="版本号")
|
|
original_file_path = Column(String(500), nullable=False, comment="原始 Word 文件路径")
|
|
status = Column(Integer, default=1, comment="1=启用 0=停用")
|
|
created_by = Column(String(50), comment="创建人")
|
|
created_at = Column(DateTime, default=datetime.now)
|
|
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
|