-- Migration: Create cron_logs table
-- Description: Logs automated cron job executions
-- Date: 2026-01-26

CREATE TABLE IF NOT EXISTS cron_logs (
  id INT AUTO_INCREMENT PRIMARY KEY,
  execution_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  duration_seconds INT,
  status VARCHAR(50),
  actions_performed JSON,
  errors JSON,

  INDEX idx_execution_time (execution_time),
  INDEX idx_status (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
