from sqlalchemy import Column, Integer, String, Text, TIMESTAMP, func from app.core.database import Base class RemoteServer(Base): __tablename__ = "remote_server" id = Column(Integer, primary_key=True, autoincrement=True) server_id = Column(String(50), unique=True, nullable=False, comment="服务器唯一标识,如 MCP1") name = Column(String(100), nullable=False, comment="服务器名称") host = Column(String(255), nullable=False, comment="服务器地址") port = Column(Integer, default=22, comment="SSH端口") username = Column(String(100), default="root", comment="SSH用户名") password = Column(String(255), nullable=True, comment="SSH密码") key_file = Column(String(255), nullable=True, comment="SSH私钥路径") project_path = Column(String(255), default="/root/troov-asyncio", comment="项目路径") created_at = Column(TIMESTAMP, server_default=func.now(), comment="创建时间") updated_at = Column(TIMESTAMP, server_default=func.now(), onupdate=func.now(), comment="更新时间")