feat(api): conditional capture - db schema

This commit is contained in:
Shekar Siri 2023-12-22 11:56:50 +01:00
parent 932bfac62f
commit c1181287f5

View file

@ -30,7 +30,16 @@ SET has_ut_test= TRUE
WHERE session_id IN (SELECT session_id FROM public.ut_tests_signals);
ALTER TABLE IF EXISTS public.projects
ADD COLUMN IF NOT EXISTS conditions jsonb DEFAULT NULL;
ADD COLUMN IF NOT EXISTS conditional_capture boolean DEFAULT FALSE;
CREATE TABLE IF NOT EXISTS public.projects_conditions
(
condition_id integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
project_id integer NOT NULL REFERENCES public.projects (project_id) ON DELETE CASCADE,
name varchar(255) NOT NULL,
capture_rate integer NOT NULL CHECK (capture_rate >= 0 AND capture_rate <= 100),
filters jsonb NOT NULL DEFAULT '[]'::jsonb
);
COMMIT;