Prepare monorepo
This commit is contained in:
parent
a1ddb43ed0
commit
938582155d
61 changed files with 5 additions and 5 deletions
19
backend/app/models/user.py
Normal file
19
backend/app/models/user.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import uuid
|
||||
from sqlalchemy import Enum, Uuid, Boolean, Column, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from app.database import Base
|
||||
from app.schemas.user import Role
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
id = Column(Uuid, primary_key=True, default=uuid.uuid4)
|
||||
friendly_name = Column(String, nullable=True)
|
||||
is_active = Column(Boolean, nullable=False, default=True)
|
||||
email = Column(String, nullable=False, unique=True, index=True)
|
||||
password = Column(String, nullable=False)
|
||||
role = Column(Enum(Role), nullable=False, default=Role.MEMBER)
|
||||
|
||||
id_tokens = relationship("IdToken", back_populates="owner", cascade="delete, delete-orphan")
|
||||
transactions = relationship("Transaction", cascade="delete, delete-orphan")
|
Loading…
Add table
Add a link
Reference in a new issue