@@ -71,6 +71,43 @@ CREATE TABLE public.compliance_checks (
71
71
);
72
72
73
73
74
+ --
75
+ -- Name: compliance_checks_alerts; Type: TABLE; Schema: public; Owner: -
76
+ --
77
+
78
+ CREATE TABLE public .compliance_checks_alerts (
79
+ id integer NOT NULL ,
80
+ title text NOT NULL ,
81
+ description text NOT NULL ,
82
+ severity text NOT NULL ,
83
+ compliance_check_id integer NOT NULL ,
84
+ project_id integer NOT NULL ,
85
+ created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL ,
86
+ updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL ,
87
+ CONSTRAINT compliance_checks_alerts_severity_check CHECK ((severity = ANY (ARRAY[' critical' ::text , ' high' ::text , ' medium' ::text , ' low' ::text , ' info' ::text ])))
88
+ );
89
+
90
+
91
+ --
92
+ -- Name: compliance_checks_alerts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
93
+ --
94
+
95
+ CREATE SEQUENCE public .compliance_checks_alerts_id_seq
96
+ AS integer
97
+ START WITH 1
98
+ INCREMENT BY 1
99
+ NO MINVALUE
100
+ NO MAXVALUE
101
+ CACHE 1 ;
102
+
103
+
104
+ --
105
+ -- Name: compliance_checks_alerts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
106
+ --
107
+
108
+ ALTER SEQUENCE public .compliance_checks_alerts_id_seq OWNED BY public .compliance_checks_alerts .id;
109
+
110
+
74
111
--
75
112
-- Name: compliance_checks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
76
113
--
@@ -372,6 +409,13 @@ ALTER SEQUENCE public.projects_id_seq OWNED BY public.projects.id;
372
409
ALTER TABLE ONLY public .compliance_checks ALTER COLUMN id SET DEFAULT nextval(' public.compliance_checks_id_seq' ::regclass);
373
410
374
411
412
+ --
413
+ -- Name: compliance_checks_alerts id; Type: DEFAULT; Schema: public; Owner: -
414
+ --
415
+
416
+ ALTER TABLE ONLY public .compliance_checks_alerts ALTER COLUMN id SET DEFAULT nextval(' public.compliance_checks_alerts_id_seq' ::regclass);
417
+
418
+
375
419
--
376
420
-- Name: github_organizations id; Type: DEFAULT; Schema: public; Owner: -
377
421
--
@@ -407,6 +451,14 @@ ALTER TABLE ONLY public.knex_migrations_lock ALTER COLUMN index SET DEFAULT next
407
451
ALTER TABLE ONLY public .projects ALTER COLUMN id SET DEFAULT nextval(' public.projects_id_seq' ::regclass);
408
452
409
453
454
+ --
455
+ -- Name: compliance_checks_alerts compliance_checks_alerts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
456
+ --
457
+
458
+ ALTER TABLE ONLY public .compliance_checks_alerts
459
+ ADD CONSTRAINT compliance_checks_alerts_pkey PRIMARY KEY (id);
460
+
461
+
410
462
--
411
463
-- Name: compliance_checks compliance_checks_code_name_unique; Type: CONSTRAINT; Schema: public; Owner: -
412
464
--
@@ -502,6 +554,13 @@ ALTER TABLE ONLY public.projects
502
554
CREATE TRIGGER set_updated_at_compliance_checks BEFORE UPDATE ON public .compliance_checks FOR EACH ROW EXECUTE FUNCTION public .update_updated_at_column ();
503
555
504
556
557
+ --
558
+ -- Name: compliance_checks_alerts set_updated_at_compliance_checks_alerts; Type: TRIGGER; Schema: public; Owner: -
559
+ --
560
+
561
+ CREATE TRIGGER set_updated_at_compliance_checks_alerts BEFORE UPDATE ON public .compliance_checks_alerts FOR EACH ROW EXECUTE FUNCTION public .update_updated_at_column ();
562
+
563
+
505
564
--
506
565
-- Name: github_organizations set_updated_at_github_organizations; Type: TRIGGER; Schema: public; Owner: -
507
566
--
@@ -523,6 +582,22 @@ CREATE TRIGGER set_updated_at_github_repositories BEFORE UPDATE ON public.github
523
582
CREATE TRIGGER set_updated_at_projects BEFORE UPDATE ON public .projects FOR EACH ROW EXECUTE FUNCTION public .update_updated_at_column ();
524
583
525
584
585
+ --
586
+ -- Name: compliance_checks_alerts compliance_checks_alerts_compliance_check_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
587
+ --
588
+
589
+ ALTER TABLE ONLY public .compliance_checks_alerts
590
+ ADD CONSTRAINT compliance_checks_alerts_compliance_check_id_foreign FOREIGN KEY (compliance_check_id) REFERENCES public .compliance_checks (id) ON UPDATE CASCADE ON DELETE CASCADE ;
591
+
592
+
593
+ --
594
+ -- Name: compliance_checks_alerts compliance_checks_alerts_project_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
595
+ --
596
+
597
+ ALTER TABLE ONLY public .compliance_checks_alerts
598
+ ADD CONSTRAINT compliance_checks_alerts_project_id_foreign FOREIGN KEY (project_id) REFERENCES public .projects (id) ON UPDATE CASCADE ON DELETE CASCADE ;
599
+
600
+
526
601
--
527
602
-- Name: github_organizations github_organizations_project_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
528
603
--
0 commit comments