remote_server.py 1.0 KB

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