Automated Action f1784ca3da Create REST API service with FastAPI and SQLite
- Set up FastAPI application with CORS middleware
- Implement SQLite database with SQLAlchemy ORM
- Create user model and schemas for data validation
- Set up Alembic for database migrations
- Add comprehensive CRUD endpoints for user management
- Include health check and service info endpoints
- Configure automatic API documentation
- Update README with complete project documentation
2025-06-26 01:43:42 +00:00

13 lines
531 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)
name = 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())