CREATE TABLE IF NOT EXISTS generated_covers (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  user_id INTEGER NOT NULL,
  song_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_covers_song ON generated_covers (user_id, song_id, created_at DESC);
