Phase-3 / src /models /user.py
suhail
Add application file
20a519c
from sqlmodel import SQLModel, Field
from datetime import datetime
from typing import Optional
class User(SQLModel, table=True):
"""User entity with authentication support."""
__tablename__ = "users"
id: Optional[int] = Field(default=None, primary_key=True)
email: str = Field(max_length=255, unique=True, nullable=False, index=True)
name: str = Field(max_length=100, nullable=False)
password_hash: str = Field(max_length=255, nullable=False)
created_at: datetime = Field(default_factory=datetime.utcnow, nullable=False)
updated_at: datetime = Field(default_factory=datetime.utcnow, nullable=False)