
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
15 lines
505 B
Python
15 lines
505 B
Python
from sqlalchemy import Column, Integer, String, Date, Text
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class Director(Base):
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String(255), nullable=False, index=True)
|
|
birth_date = Column(Date, nullable=True)
|
|
bio = Column(Text, nullable=True)
|
|
photo_path = Column(String(255), nullable=True)
|
|
|
|
# One-to-many relationship
|
|
movies = relationship("Movie", back_populates="director") |