-- What a user decided about an artist: wanted it ('wishlist') or is not interested -- ('dismissed'). One row per user and artist, so it is one or the other. -- -- The artist can be one without files that a provider named. The row keeps such an -- artist from being cleaned up when the list that named it is replaced (see the -- storage code); only taking a provider's data back removes it, and the row with it. CREATE TABLE artist_feedback ( user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE, artist_id INTEGER NOT NULL REFERENCES artists(id) ON DELETE CASCADE, kind TEXT NOT NULL CHECK (kind IN ('wishlist', 'dismissed')), created_at INTEGER NOT NULL, -- unix seconds PRIMARY KEY (user_id, artist_id) ); CREATE INDEX idx_artist_feedback_artist ON artist_feedback(artist_id); CREATE INDEX idx_artist_feedback_list ON artist_feedback(user_id, kind, created_at);