"""YakPanel - FTP model"""
from datetime import datetime
from sqlalchemy import String, Integer, DateTime, ForeignKey
from sqlalchemy.orm import Mapped, mapped_column
from app.core.database import Base


class Ftp(Base):
    __tablename__ = "ftps"

    id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
    pid: Mapped[int] = mapped_column(Integer, ForeignKey("sites.id"), default=0)
    name: Mapped[str] = mapped_column(String(64), nullable=False)
    password: Mapped[str] = mapped_column(String(255), nullable=False)
    path: Mapped[str] = mapped_column(String(512), nullable=False)
    ps: Mapped[str] = mapped_column(String(255), default="")
    addtime: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
