
- 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)
11 lines
440 B
Python
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()) |