-- Cable test results: submitted by app via api/cable_test_result.php for history/dashboard.
CREATE TABLE IF NOT EXISTS cable_test_results (
  id INT AUTO_INCREMENT PRIMARY KEY,
  device_id VARCHAR(64) NOT NULL,
  mode VARCHAR(32) NOT NULL,
  result_json TEXT NOT NULL,
  passed TINYINT(1) NOT NULL DEFAULT 0,
  created_at DATETIME NOT NULL,
  INDEX idx_cable_test_results_device (device_id),
  INDEX idx_cable_test_results_created (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS ftt_cable_test_results (
  id INT AUTO_INCREMENT PRIMARY KEY,
  device_id VARCHAR(64) NOT NULL,
  mode VARCHAR(32) NOT NULL,
  result_json TEXT NOT NULL,
  passed TINYINT(1) NOT NULL DEFAULT 0,
  created_at DATETIME NOT NULL,
  INDEX idx_ftt_cable_test_results_device (device_id),
  INDEX idx_ftt_cable_test_results_created (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
