ALTER TABLE "cluster_mix_rule" ADD COLUMN discovery_count INT NOT NULL DEFAULT 15; -- New songs to suggest per mix ALTER TABLE "cluster_mix_playlist" ADD COLUMN name VARCHAR(250), -- Name of the playlist in subsonic ADD COLUMN position INT NOT NULL DEFAULT 0; -- Order of the mix, most listened first -- Songs not in the library, recommended by Listenbrainz and matched to a mix by genre CREATE TABLE "mix_suggestion" ( id UUID NOT NULL PRIMARY KEY, rule_id UUID NOT NULL REFERENCES "cluster_mix_rule" (id) ON DELETE CASCADE, mix_id UUID REFERENCES "cluster_mix_playlist" (id) ON DELETE SET NULL, recording_mbid VARCHAR(36) NOT NULL, title VARCHAR(500) NOT NULL, artist VARCHAR(500) NOT NULL, release VARCHAR(500), cover_url TEXT, score DOUBLE PRECISION NOT NULL, status VARCHAR(16) NOT NULL DEFAULT 'new', -- new, liked or dismissed youtube_id VARCHAR(32), -- Cached YouTube match created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), UNIQUE (rule_id, recording_mbid) );