config di lifespan
This commit is contained in:
5
api/infrastructure/persistence/models/base.py
Normal file
5
api/infrastructure/persistence/models/base.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from sqlalchemy.orm import DeclarativeBase
|
||||
|
||||
|
||||
class Base(DeclarativeBase):
|
||||
...
|
18
api/infrastructure/persistence/models/user.py
Normal file
18
api/infrastructure/persistence/models/user.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import UUID
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from api.infrastructure.persistence.models.base import Base
|
||||
|
||||
|
||||
class UserModel(Base):
|
||||
__tablename__ = "user"
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
)
|
||||
name: Mapped[str]
|
||||
email: Mapped[str] = mapped_column(unique=True)
|
||||
hashed_password: Mapped[str]
|
Reference in New Issue
Block a user