Automated Action 0186fc8e70 Create movie database backend with FastAPI and SQLite
This commit implements a simple movie database backend inspired by IMDb. It includes:
- API endpoints for movies, actors, directors and genres
- SQLAlchemy models with relationships
- Alembic migrations
- Pydantic schemas for request/response validation
- Search and filtering functionality
- Health check endpoint
- Complete documentation
2025-05-19 20:28:07 +00:00

12 lines
390 B
Python

from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import relationship
from app.db.base_class import Base
class Genre(Base):
id = Column(Integer, primary_key=True, index=True)
name = Column(String(50), nullable=False, unique=True, index=True)
# Many-to-many relationship
movies = relationship("Movie", secondary="moviegenre", back_populates="genres")