Automated Action 4d6c2e1778 Implement Anime Information API with FastAPI and SQLite
- Create project structure and dependencies
- Set up SQLAlchemy models for anime, genres, and their relationships
- Implement CRUD operations for all models
- Set up FastAPI endpoints for managing anime and genres
- Add health check endpoint
- Configure Alembic for database migrations
- Add data seeding capability
- Update README with project information
2025-05-17 21:37:16 +00:00

21 lines
1010 B
Python

from sqlalchemy import Column, Integer, String, Float, Text, Date
from app.db.base_class import Base
class Anime(Base):
id = Column(Integer, primary_key=True, index=True)
title = Column(String(255), index=True, nullable=False)
alternative_titles = Column(String(500), nullable=True)
synopsis = Column(Text, nullable=True)
episodes = Column(Integer, nullable=True)
status = Column(String(50), nullable=True) # airing, finished, upcoming
aired_from = Column(Date, nullable=True)
aired_to = Column(Date, nullable=True)
duration = Column(String(50), nullable=True) # per episode (e.g., "24 min per ep")
rating = Column(String(50), nullable=True) # PG-13, R, etc.
score = Column(Float, nullable=True)
ranked = Column(Integer, nullable=True)
popularity = Column(Integer, nullable=True)
studio = Column(String(100), nullable=True)
source = Column(String(50), nullable=True) # manga, light novel, etc.
image_url = Column(String(255), nullable=True)