12 lines
555 B
SQL
12 lines
555 B
SQL
-- The TV counterpart of movie_releases (0003). One release comes back for
|
|
-- more than one episode — a season pack matches every episode in the season —
|
|
-- so the release row stays unique by indexer and guid, and each match is a
|
|
-- row here.
|
|
CREATE TABLE episode_releases (
|
|
episode_id INTEGER NOT NULL REFERENCES episodes (id) ON DELETE CASCADE,
|
|
release_id INTEGER NOT NULL REFERENCES releases (id) ON DELETE CASCADE,
|
|
PRIMARY KEY (episode_id, release_id)
|
|
) STRICT;
|
|
|
|
CREATE INDEX episode_releases_release ON episode_releases (release_id);
|