17 lines
673 B
Python
17 lines
673 B
Python
"""YakPanel - Crontab model"""
|
|
from datetime import datetime
|
|
from sqlalchemy import String, Integer, DateTime, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from app.core.database import Base
|
|
|
|
|
|
class Crontab(Base):
|
|
__tablename__ = "crontab"
|
|
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
|
name: Mapped[str] = mapped_column(String(128), default="")
|
|
type: Mapped[str] = mapped_column(String(32), default="shell")
|
|
execstr: Mapped[str] = mapped_column(Text, default="")
|
|
schedule: Mapped[str] = mapped_column(String(64), default="")
|
|
addtime: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|