Cascade deleted tracks to playlist_rows and playdates
This commit is contained in:
parent
4927f237ab
commit
2f18ef5f44
@ -147,12 +147,15 @@ class TracksTable(Model):
|
|||||||
title: Mapped[str] = mapped_column(String(256), index=True)
|
title: Mapped[str] = mapped_column(String(256), index=True)
|
||||||
|
|
||||||
playlistrows: Mapped[list[PlaylistRowsTable]] = relationship(
|
playlistrows: Mapped[list[PlaylistRowsTable]] = relationship(
|
||||||
"PlaylistRowsTable", back_populates="track"
|
"PlaylistRowsTable",
|
||||||
|
back_populates="track",
|
||||||
|
cascade="all, delete-orphan",
|
||||||
)
|
)
|
||||||
playlists = association_proxy("playlistrows", "playlist")
|
playlists = association_proxy("playlistrows", "playlist")
|
||||||
playdates: Mapped[list[PlaydatesTable]] = relationship(
|
playdates: Mapped[list[PlaydatesTable]] = relationship(
|
||||||
"PlaydatesTable",
|
"PlaydatesTable",
|
||||||
back_populates="track",
|
back_populates="track",
|
||||||
|
cascade="all, delete-orphan",
|
||||||
lazy="joined",
|
lazy="joined",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user