17 lines
489 B
Python
17 lines
489 B
Python
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")
|