- PUT/DELETE /wishlist/{artist} and GET /wishlist: the artists I want.
- POST/DELETE /discover/{artist}/dismiss and GET /discover/dismissed: the
artists I am not interested in. An artist is wished or dismissed, never both,
and both lists are mine alone.
- Discover never suggests a dismissed artist, does not use one as a seed taken
from my listening, and marks the wished ones it shows (wishlisted).
- New artist_feedback table (migration 0012, SQLite and PostgreSQL), removed
with the account.
- An artist I marked is not cleaned up when the list that named it is replaced,
and goes when its last mark is taken off and nobody names it. Taking a
provider's data back still removes what only it named, marks included.
- Spec, contract test and README updated.
Closes #35
17 lines
913 B
SQL
17 lines
913 B
SQL
-- 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 BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
artist_id BIGINT NOT NULL REFERENCES artists(id) ON DELETE CASCADE,
|
|
kind TEXT NOT NULL CHECK (kind IN ('wishlist', 'dismissed')),
|
|
created_at BIGINT 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);
|