Use generated column for risk score

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-05-22 16:13:19 -07:00
parent 9c5828b525
commit 62a0fb96b7
3 changed files with 14 additions and 10 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE risks ADD COLUMN inherent_risk_score INTEGER GENERATED ALWAYS AS (inherent_impact * inherent_likelihood) STORED;
ALTER TABLE risks ADD COLUMN residual_risk_score INTEGER GENERATED ALWAYS AS (residual_impact * residual_likelihood) STORED;