-- Run this in phpMyAdmin to add required columns for automation.
ALTER TABLE jobs
  ADD COLUMN email VARCHAR(255) NULL,
  ADD COLUMN encrypted_password TEXT NULL,
  ADD COLUMN api_key TEXT NULL,
  ADD COLUMN updated_at TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP;

-- Normalize status values: pending / processing / done
UPDATE jobs SET status = 'pending' WHERE status IS NULL OR status = '';