Reafctor app
This commit is contained in:
parent
b8216f6ade
commit
7740be8bb5
36 changed files with 389 additions and 208 deletions
16
app/models/chargepoint.py
Normal file
16
app/models/chargepoint.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
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)
|
||||
|
||||
connectors = relationship("Connector", cascade="delete, delete-orphan")
|
Loading…
Add table
Add a link
Reference in a new issue