
- 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
12 lines
466 B
Python
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()) |