Automated Action cbb631170b Create a quick and simple FastAPI application with SQLite
This commit includes:
- Basic project structure with FastAPI
- SQLite database integration using SQLAlchemy
- CRUD API for items
- Alembic migrations setup
- Health check endpoint
- Proper error handling
- Updated README with setup instructions
2025-06-06 00:29:59 +00:00

14 lines
528 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from app.db.base import Base
class Item(Base):
__tablename__ = "items"
id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True, nullable=False)
description = Column(String, nullable=True)
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())