Automated Action 109d0c91b8 Create FastAPI application with basic CRUD functionality
- Set up project structure with FastAPI app
- Implement items CRUD API endpoints
- Configure SQLite database with SQLAlchemy
- Set up Alembic migrations
- Add health check endpoint
- Enable CORS middleware
- Create README with documentation
2025-06-06 09:44:58 +00:00

12 lines
466 B
Python

from sqlalchemy import Column, Integer, String, Text, 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)
title = Column(String(100), nullable=False)
description = Column(Text, nullable=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())