Automated Action 07301a47e7 Implement RESTful API using FastAPI and SQLite
- Set up project structure with FastAPI framework
- Implement database models using SQLAlchemy
- Create Alembic migrations for database schema
- Build CRUD endpoints for Items resource
- Add health check endpoint
- Include API documentation with Swagger and ReDoc
- Update README with project documentation
2025-05-18 16:46:51 +00:00

16 lines
544 B
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime
from sqlalchemy.sql import func
from app.db.database 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())