
-- qa-tool schema
CREATE TABLE IF NOT EXISTS reports (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  module VARCHAR(255),
  module_version VARCHAR(100),
  pbx_version VARCHAR(100),
  olm_nummer VARCHAR(100),
  tester VARCHAR(255),
  docbee_url TEXT,
  summary VARCHAR(255),
  pdf_path TEXT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS steps (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  report_id BIGINT NOT NULL,
  step_index INT,
  step_id VARCHAR(50),
  title TEXT,
  expected TEXT,
  status ENUM('pass','fail','skip','na','') DEFAULT '',
  comment TEXT,
  evidence TEXT,
  group_title VARCHAR(255),
  group_index INT,
  CONSTRAINT fk_steps_report FOREIGN KEY (report_id) REFERENCES reports(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
