sonda/migrations/postgres/0033_lidarr_requests.sql
tgiachi af933ad9ea feat(lidarr): a page of the artists I sent to Lidarr, and whether they arrived
Sonda kept no record of what an admin sent to Lidarr. Each send is now kept
(migration 0033, lidarr_requests), once for each artist, with the first date.
GET /lidarr/requests lists them newest first and says for each whether its
music is in the library: it is noticed when the list is read, by the artist
that was sent or by an artist of the same name that a scan made, and the day
it first was is kept.

The web app has a Requests page for admins, under Discover in the menu and on
Home on a phone, with the waiting and the arrived artists apart.
2026-11-15 12:32:29 +01:00

15 lines
627 B
SQL

-- PostgreSQL flavour of sqlite/0033_lidarr_requests.sql.
CREATE TABLE lidarr_requests (
id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
artist_id BIGINT REFERENCES artists(id) ON DELETE SET NULL,
artist_name TEXT NOT NULL,
artist_key TEXT NOT NULL,
artist_mbid TEXT,
requested_at BIGINT NOT NULL,
arrived_at BIGINT
);
CREATE UNIQUE INDEX idx_lidarr_requests_artist ON lidarr_requests(user_id, artist_key);
CREATE INDEX idx_lidarr_requests_time ON lidarr_requests(user_id, requested_at DESC);