
- Add FastAPI application with CORS support - Implement SQLite database with SQLAlchemy - Create Item model with CRUD operations - Setup Alembic for database migrations - Add comprehensive API endpoints for Items - Include health check endpoint - Update README with documentation
12 lines
441 B
Python
12 lines
441 B
Python
from sqlalchemy import Column, Integer, String, 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)
|
|
description = Column(String)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |