22 lines
723 B
Python
22 lines
723 B
Python
import uuid
|
|
from sqlalchemy import Uuid, Boolean, Column, DateTime, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.database import Base
|
|
|
|
class ChargePoint(Base):
|
|
__tablename__ = "chargepoints"
|
|
|
|
id = Column(Uuid, primary_key=True, default=uuid.uuid4)
|
|
friendly_name = Column(String, unique=True, index=True)
|
|
is_active = Column(Boolean, default=True)
|
|
password = Column(String)
|
|
|
|
last_seen = Column(DateTime, nullable=True)
|
|
vendor_name = Column(String, nullable=True)
|
|
model = Column(String, nullable=True)
|
|
serial_number = Column(String, nullable=True)
|
|
firmware_version = Column(String, nullable=True)
|
|
|
|
connectors = relationship("Connector", cascade="delete, delete-orphan")
|