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

17 lines
497 B
Python
Raw Permalink Normal View History

2024-04-13 22:43:03 +02:00
import uuid
from sqlalchemy import Uuid, Boolean, Column, ForeignKey, String
from sqlalchemy.orm import relationship
from app.database import Base
class IdToken(Base):
__tablename__ = "id_tokens"
id = Column(Uuid, primary_key=True, default=uuid.uuid4)
2024-04-14 17:34:46 +02:00
friendly_name = Column(String)
2024-04-13 22:43:03 +02:00
is_active = Column(Boolean, default=True)
token = Column(String, index=True)
owner_id = Column(Uuid, ForeignKey("users.id"))
owner = relationship("User", back_populates="id_tokens")