14 lines
718 B
Python
14 lines
718 B
Python
from sqlalchemy import Column, Integer, String, Text, DateTime, func
|
|
from database import Base
|
|
|
|
class Template(Base):
|
|
__tablename__ = "templates"
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
name = Column(String(255), nullable=False, comment="模板名称")
|
|
description = Column(Text, default="", comment="描述")
|
|
file_path = Column(String(500), nullable=False, comment="原始模板文件路径")
|
|
paragraph_count = Column(Integer, default=0, comment="段落数")
|
|
status = Column(String(20), default="draft", comment="draft/ready")
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|