init
This commit is contained in:
15
app/models/user.py
Normal file
15
app/models/user.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import uuid
|
||||
from datetime import datetime, timezone
|
||||
from sqlmodel import SQLModel, Field
|
||||
|
||||
|
||||
class User(SQLModel, table=True):
|
||||
__tablename__ = "users"
|
||||
|
||||
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
|
||||
username: str = Field(max_length=32, unique=True, index=True)
|
||||
email: str = Field(unique=True, index=True)
|
||||
password_hash: str
|
||||
avatar_url: str | None = None
|
||||
fcm_token: str | None = None
|
||||
created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
||||
Reference in New Issue
Block a user