-- Add Likelihood and Consequence fields for risk calculations
-- Run this SQL to add the risk calculation columns

-- For GRA Hazards
ALTER TABLE gra_hazards
ADD COLUMN likelihood INT DEFAULT 1 AFTER current_controls,
ADD COLUMN consequence INT DEFAULT 1 AFTER likelihood,
ADD COLUMN residual_likelihood INT DEFAULT 1 AFTER risk_level,
ADD COLUMN residual_consequence INT DEFAULT 1 AFTER residual_likelihood;

-- For RA Hazard Analysis
ALTER TABLE ra_hazard_analysis
ADD COLUMN likelihood INT DEFAULT 1 AFTER current_controls,
ADD COLUMN consequence INT DEFAULT 1 AFTER likelihood,
ADD COLUMN residual_likelihood INT DEFAULT 1 AFTER residual_risk,
ADD COLUMN residual_consequence INT DEFAULT 1 AFTER residual_likelihood;

-- These columns will store the L and C values (1-5) for L × C calculation
-- The degree of risk is calculated as: L × C
-- Low: 1-3, Medium: 4-6, High: 7-12, Critical: 13+
