Automated Action 852e0a32b1 Create simple FastAPI application with SQLite and Alembic
- Set up project structure
- Create FastAPI app with health endpoint
- Implement SQLAlchemy with SQLite database
- Set up Alembic for database migrations
- Create CRUD operations for items
- Add comprehensive documentation
2025-05-20 14:20:21 +00:00

16 lines
543 B
Python

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