-- Create mock_templates table for AI Mock Settings
-- Run this in your MySQL database

CREATE TABLE IF NOT EXISTS mock_templates (
  id INT PRIMARY KEY AUTO_INCREMENT,
  role_id INT NOT NULL,
  title VARCHAR(255) NOT NULL,
  total_questions INT DEFAULT 10,
  duration_minutes INT DEFAULT 30,
  allowed_difficulty JSON,
  required_skill_ids JSON,
  is_active TINYINT DEFAULT 1,
  created_by INT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Index for faster role-based lookups
CREATE INDEX idx_mock_templates_role_id ON mock_templates(role_id);
CREATE INDEX idx_mock_templates_is_active ON mock_templates(is_active);
