Add control-policy mappings and rename control APIs

This introduces the ability to map controls to policies alongside the
existing control-mitigation mappings. The feature adds bidirectional
relationships with new GraphQL fields on Control and Policy types.

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-04-08 21:14:11 -07:00
parent 348e2641bb
commit 4ce72c03f7
17 changed files with 1630 additions and 207 deletions

View File

@@ -0,0 +1,7 @@
CREATE TABLE controls_policies (
control_id TEXT NOT NULL REFERENCES controls(id),
policy_id TEXT NOT NULL REFERENCES policies(id),
tenant_id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
PRIMARY KEY (control_id, policy_id)
);