Automated Action a4ffe78f61 Create REST API with FastAPI and SQLAlchemy
- Set up project structure with FastAPI
- Create SQLite database with SQLAlchemy
- Implement Alembic for database migrations
- Add CRUD operations for items resource
- Create health endpoint
- Update documentation

generated with BackendIM... (backend.im)
2025-05-14 10:26:10 +00:00

11 lines
440 B
Python

from sqlalchemy import Column, Integer, String, Text, DateTime
from sqlalchemy.sql import func
from app.db.base_class import Base
class Item(Base):
id = Column(Integer, primary_key=True, index=True)
title = Column(String(100), index=True)
description = Column(Text, nullable=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())