-- Table to track proxy testing jobs
CREATE TABLE IF NOT EXISTS proxy_test_jobs (
  id SERIAL PRIMARY KEY,
  status VARCHAR(20) NOT NULL DEFAULT 'pending', -- pending, running, completed, cancelled
  total_proxies INTEGER NOT NULL DEFAULT 0,
  tested_proxies INTEGER NOT NULL DEFAULT 0,
  passed_proxies INTEGER NOT NULL DEFAULT 0,
  failed_proxies INTEGER NOT NULL DEFAULT 0,
  started_at TIMESTAMP,
  completed_at TIMESTAMP,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Index for quick status lookups
CREATE INDEX IF NOT EXISTS idx_proxy_test_jobs_status ON proxy_test_jobs(status);
CREATE INDEX IF NOT EXISTS idx_proxy_test_jobs_created_at ON proxy_test_jobs(created_at DESC);
