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

17 lines
489 B
Python
Raw 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)
title = Column(String)
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")