simple-ocpp-cs/backend/app/models/firmware_update.py

20 lines
669 B
Python

import uuid
from sqlalchemy import Column, DateTime, Enum, ForeignKey, Integer, String, Uuid
from app.database import Base
from app.schemas.firmware_update import FirmwareUpdateStatus
class FirmwareUpdate(Base):
__tablename__ = "firmware_updates"
id = Column(Uuid, primary_key=True, default=uuid.uuid4)
request_id = Column(Integer)
status = Column(Enum(FirmwareUpdateStatus))
retries = Column(Integer)
retry_interval = Column(Integer)
location = Column(String)
retrieve_date_time = Column(DateTime)
install_date_time = Column(DateTime, nullable=True)
chargepoint_id = Column(Uuid, ForeignKey("chargepoints.id"), index=True)