Automated Action 93c528a258 Create FastAPI REST API with SQLite
- Set up project structure and dependencies
- Create database models with SQLAlchemy
- Implement API endpoints for CRUD operations
- Set up Alembic for database migrations
- Add health check endpoint
- Configure Ruff for linting
- Update documentation in README
2025-05-29 10:18:27 +00:00

15 lines
532 B
Python

from sqlalchemy import Boolean, Column, Integer, String, Text
from sqlalchemy.sql import func
from sqlalchemy.sql.sqltypes import DateTime
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)
is_active = Column(Boolean, default=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())