Automated Action 16d63c4168 Create FastAPI REST API service with SQLite database
- Set up FastAPI application with CORS support
- Implement SQLite database with SQLAlchemy ORM
- Create User model with CRUD operations
- Add Alembic for database migrations
- Include health check and documentation endpoints
- Set up proper project structure with organized modules
- Add comprehensive README with setup instructions
- Configure Ruff for code linting and formatting
2025-07-03 18:56:01 +00:00

15 lines
533 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())