feat(DB): removed funnels table

This commit is contained in:
Taha Yassine Kraiem 2023-01-23 15:15:55 +01:00
parent 716c40fd1f
commit 71e67ac408
4 changed files with 2 additions and 33 deletions

View file

@ -329,7 +329,7 @@ DROP FUNCTION get_new_filter_key;
DROP FUNCTION get_new_event_filter_key;
DROP FUNCTION get_new_event_key;
DROP TABLE IF EXISTS public.funnels;
COMMIT;
CREATE INDEX CONCURRENTLY IF NOT EXISTS clicks_selector_idx ON events.clicks (selector);

View file

@ -109,7 +109,6 @@ $$
('dashboards'),
('dashboard_widgets'),
('errors'),
('funnels'),
('integrations'),
('issues'),
('jira_cloud'),
@ -336,21 +335,6 @@ $$
);
CREATE TABLE IF NOT EXISTS funnels
(
funnel_id integer generated BY DEFAULT AS IDENTITY PRIMARY KEY,
project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE,
name text NOT NULL,
filter jsonb NOT NULL,
created_at timestamp DEFAULT timezone('utc'::text, now()) NOT NULL,
deleted_at timestamp,
is_public boolean NOT NULL DEFAULT False
);
CREATE INDEX IF NOT EXISTS funnels_user_id_is_public_idx ON public.funnels (user_id, is_public);
CREATE INDEX IF NOT EXISTS funnels_project_id_idx ON public.funnels (project_id);
IF NOT EXISTS(SELECT *
FROM pg_type typ
WHERE typ.typname = 'announcement_type') THEN

View file

@ -300,6 +300,7 @@ $$
$$
LANGUAGE plpgsql;
DROP TABLE IF EXISTS public.funnels;
COMMIT;
CREATE INDEX CONCURRENTLY IF NOT EXISTS clicks_selector_idx ON events.clicks (selector);

View file

@ -249,22 +249,6 @@ $$
);
CREATE TABLE funnels
(
funnel_id integer generated BY DEFAULT AS IDENTITY PRIMARY KEY,
project_id integer NOT NULL REFERENCES projects (project_id) ON DELETE CASCADE,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE,
name text NOT NULL,
filter jsonb NOT NULL,
created_at timestamp DEFAULT timezone('utc'::text, now()) NOT NULL,
deleted_at timestamp,
is_public boolean NOT NULL DEFAULT False
);
CREATE INDEX funnels_user_id_is_public_idx ON public.funnels (user_id, is_public);
CREATE INDEX funnels_project_id_idx ON public.funnels (project_id);
CREATE TYPE announcement_type AS ENUM ('notification', 'alert');
CREATE TABLE announcements