score_risk
Calculate a combined risk score for SQL migrations, aggregating lock severity and data loss potential into a single 0-100 score for CI gate automation.
Instructions
Calculate the combined risk score (0-100) for a SQL migration. Aggregates both lock risk severity (ACCESS EXCLUSIVE, SHARE locks) and data loss potential (DROP, TRUNCATE, type changes) into a single score. Useful for CI gates and automated migration review pipelines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL content of the migration file | |
| filename | Yes | Migration filename |