CREATE TABLE jobs (
  id INT AUTO_INCREMENT PRIMARY KEY,
  type VARCHAR(50),
  status ENUM('pending','running','paused','finished','failed'),
  total INT DEFAULT 0,
  done INT DEFAULT 0,
  progress INT DEFAULT 0,
  payload JSON,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
