
CREATE TABLE "public"."compliance_rule_executions" ("id" serial NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), "rule_id" UUID NOT NULL, "compliance_id" uuid NOT NULL, "status" text NOT NULL, "account_id" uuid NOT NULL, "last_execution" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , FOREIGN KEY ("rule_id") REFERENCES "public"."compliance_rules"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("compliance_id") REFERENCES "public"."compliance"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("account_id") REFERENCES "public"."cloud_accounts"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("status") REFERENCES "public"."compliance_check_finding_status_type"("value") ON UPDATE no action ON DELETE no action);
