22 lines
775 B
Python
22 lines
775 B
Python
import uuid
|
|
from sqlalchemy import Column, DateTime, Enum, ForeignKey, Integer, String, Text, 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)
|
|
signing_certificate = Column(Text, nullable=True)
|
|
signature = Column(String, nullable=True)
|
|
|
|
chargepoint_id = Column(Uuid, ForeignKey("chargepoints.id"), index=True)
|