jam-cloud/db/up/recordings_genres.sql

7 lines
325 B
MySQL
Raw Normal View History

-- recording -> genre mapping
CREATE TABLE recordings_genres (
recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE,
genre_id VARCHAR(64) NOT NULL REFERENCES genres(id) ON DELETE CASCADE
);
ALTER TABLE recordings_genres ADD CONSTRAINT recording_genre_uniqkey UNIQUE (recording_id, genre_id);