-- -------------------------------------------
--  List of users approved for specific risks
-- -------------------------------------------
DROP TABLE IF EXISTS sod_approved_user;
CREATE TABLE IF NOT EXISTS `sod_approved_user` (
	risk_id INT NOT NULL,
	username VARCHAR(12) NOT NULL,
	`system` VARCHAR(8) NOT NULL,
	client VARCHAR(3) NOT NULL,
	PRIMARY KEY (risk_id, username, `system`, client),

CONSTRAINT fk_approved_risk
    FOREIGN KEY (risk_id)
    REFERENCES sod_rule (id)
    ON DELETE CASCADE
    ON UPDATE NO ACTION
);