Commit 5a953095 authored by echel0n's avatar echel0n
Browse files

Fixed SQL relationship issues between TV Shows and Episodes

parent 81c2da37
......@@ -331,7 +331,8 @@ class MainDB(SRDatabase):
last_backlog_search = Column(DateTime(timezone=True),
last_proper_search = Column(DateTime(timezone=True),
episodes = relationship('TVEpisode', uselist=True, backref='tv_shows', cascade="all, delete-orphan", lazy='dynamic')
episodes = relationship('TVEpisode', uselist=True, back_populates='show', cascade="all, delete-orphan", lazy='dynamic')
imdb_info = relationship('IMDbInfo', uselist=False, backref='tv_shows', cascade="all, delete-orphan")
series_provider_mapping = relationship('SeriesProviderMapping', uselist=False, backref='tv_shows', cascade="all, delete-orphan")
blacklist = relationship('Blacklist', uselist=False, backref='tv_shows', cascade="all, delete-orphan")
......@@ -380,7 +381,7 @@ class MainDB(SRDatabase):
version = Column(Integer, default=-1)
release_group = Column(Text, default='')
show = relationship('TVShow', uselist=False, backref='tv_episodes')
show = relationship('TVShow', uselist=False, back_populates='episodes')
class IMDbInfo(base):
__tablename__ = 'imdb_info'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment