CREATE TABLE IF NOT EXISTS generated_playlist_covers (
  id          INTEGER PRIMARY KEY AUTOINCREMENT,
  user_id     INTEGER NOT NULL,
  playlist_id INTEGER NOT NULL,
  job_id      TEXT,
  status      TEXT NOT NULL DEFAULT 'pending',
  image_path  TEXT,
  error_message TEXT,
  created_at  DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS generated_playlist_covers_playlist
  ON generated_playlist_covers (user_id, playlist_id, created_at DESC);
