Prepare monorepo
This commit is contained in:
parent
a1ddb43ed0
commit
938582155d
61 changed files with 5 additions and 5 deletions
27
backend/app/models/chargepoint.py
Normal file
27
backend/app/models/chargepoint.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import uuid
|
||||
from sqlalchemy import ForeignKey, Numeric, 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)
|
||||
identity = Column(String, unique=True, index=True)
|
||||
is_active = Column(Boolean, default=True)
|
||||
password = Column(String)
|
||||
price = Column(Numeric(10, 2))
|
||||
|
||||
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)
|
||||
|
||||
learn_user_id = Column(Uuid, ForeignKey("users.id"), nullable=True)
|
||||
learn_until = Column(DateTime, nullable=True)
|
||||
|
||||
connectors = relationship("Connector", cascade="delete, delete-orphan")
|
||||
transactions = relationship("Transaction", cascade="delete, delete-orphan")
|
||||
variables = relationship("ChargepointVariable", cascade="delete, delete-orphan")
|
Loading…
Add table
Add a link
Reference in a new issue