
- Implement user authentication with JWT tokens - Add messaging system for sending/receiving messages - Create SQLite database with SQLAlchemy models - Set up Alembic for database migrations - Add health check endpoint - Include comprehensive API documentation - Support user registration, login, and message management - Enable conversation history and user listing
14 lines
613 B
Python
14 lines
613 B
Python
from sqlalchemy import Column, Integer, String, DateTime, Boolean
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
username = Column(String, unique=True, index=True, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |