mirror of
https://github.com/StepanovPlaton/torrent_backend.git
synced 2026-04-03 20:30:38 +04:00
Update database architecture. Add genres and actors
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from sqlalchemy import Column, ForeignKey, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from ..database import Base
|
||||
|
||||
@@ -14,7 +15,6 @@ class Movie(Base):
|
||||
description = Column(String)
|
||||
|
||||
torrent_file = Column(String, nullable=False)
|
||||
upload_date = Column(String, nullable=False)
|
||||
trailer = Column(String)
|
||||
update_date = Column(String, nullable=False)
|
||||
language = Column(String)
|
||||
@@ -25,4 +25,10 @@ class Movie(Base):
|
||||
duration = Column(String)
|
||||
country = Column(String)
|
||||
|
||||
genres = relationship("MovieGenre", secondary="movie_to_genre",
|
||||
lazy="selectin")
|
||||
|
||||
actors = relationship("MovieActor", secondary="movie_to_actor",
|
||||
lazy="selectin")
|
||||
|
||||
owner_id = Column(Integer, ForeignKey("users.id"))
|
||||
|
||||
Reference in New Issue
Block a user