diff --git a/scripts/schema/db/init_dbs/postgresql/1.17.0/1.17.0.sql b/scripts/schema/db/init_dbs/postgresql/1.17.0/1.17.0.sql index f8f51809e..7028db134 100644 --- a/scripts/schema/db/init_dbs/postgresql/1.17.0/1.17.0.sql +++ b/scripts/schema/db/init_dbs/postgresql/1.17.0/1.17.0.sql @@ -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;