
- Set up project structure with FastAPI and SQLAlchemy - Configure SQLite database with async support - Implement CRUD endpoints for items resource - Add health endpoint for monitoring - Set up Alembic migrations - Create comprehensive documentation generated with BackendIM... (backend.im)
12 lines
464 B
Python
12 lines
464 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime, func
|
|
from app.db.base import Base
|
|
|
|
class Item(Base):
|
|
__tablename__ = "items"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String, index=True)
|
|
description = Column(String)
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now()) |