simple-ocpp-cs/app/models/user.py

16 lines
532 B
Python
Raw Permalink Normal View History

2024-04-13 22:43:03 +02:00
import uuid
from sqlalchemy import Uuid, Boolean, Column, String
from sqlalchemy.orm import relationship
from app.database import Base
class User(Base):
__tablename__ = "users"
id = Column(Uuid, primary_key=True, default=uuid.uuid4)
friendly_name = Column(String, unique=True, index=True)
is_active = Column(Boolean, default=True)
id_tokens = relationship("IdToken", back_populates="owner", cascade="delete, delete-orphan")
2024-04-19 00:08:29 +02:00
transactions = relationship("Transaction", cascade="delete, delete-orphan")