2024-04-13 22:43:03 +02:00
|
|
|
import uuid
|
|
|
|
from sqlalchemy import Uuid, Boolean, Column, DateTime, String
|
2024-03-28 21:23:25 +01:00
|
|
|
from sqlalchemy.orm import relationship
|
|
|
|
|
2024-04-13 22:43:03 +02:00
|
|
|
from app.database import Base
|
2024-03-28 21:23:25 +01:00
|
|
|
|
|
|
|
class ChargePoint(Base):
|
|
|
|
__tablename__ = "chargepoints"
|
|
|
|
|
2024-04-13 22:43:03 +02:00
|
|
|
id = Column(Uuid, primary_key=True, default=uuid.uuid4)
|
2024-03-28 21:23:25 +01:00
|
|
|
friendly_name = Column(String, unique=True, index=True)
|
|
|
|
is_active = Column(Boolean, default=True)
|
|
|
|
password = Column(String)
|
2024-04-14 17:55:26 +02:00
|
|
|
|
2024-03-28 21:23:25 +01:00
|
|
|
last_seen = Column(DateTime, nullable=True)
|
2024-04-14 17:55:26 +02:00
|
|
|
vendor_name = Column(String, nullable=True)
|
|
|
|
model = Column(String, nullable=True)
|
|
|
|
serial_number = Column(String, nullable=True)
|
|
|
|
firmware_version = Column(String, nullable=True)
|
2024-03-28 21:23:25 +01:00
|
|
|
|
2024-04-13 22:43:03 +02:00
|
|
|
connectors = relationship("Connector", cascade="delete, delete-orphan")
|