From 71e67ac4088ad8fa40ccb0ee8429c514efd757bc Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Mon, 23 Jan 2023 15:15:55 +0100 Subject: [PATCH] feat(DB): removed funnels table --- .../db/init_dbs/postgresql/1.10.0/1.10.0.sql | 2 +- .../db/init_dbs/postgresql/init_schema.sql | 16 ---------------- .../db/init_dbs/postgresql/1.10.0/1.10.0.sql | 1 + .../db/init_dbs/postgresql/init_schema.sql | 16 ---------------- 4 files changed, 2 insertions(+), 33 deletions(-) diff --git a/ee/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql b/ee/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql index 090cc5b4a..0e9701f5f 100644 --- a/ee/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql +++ b/ee/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql @@ -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); diff --git a/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql b/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql index 91e6d6d7b..a16955ac9 100644 --- a/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql +++ b/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql @@ -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 diff --git a/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql b/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql index d208e5ff0..9bfef752e 100644 --- a/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql +++ b/scripts/schema/db/init_dbs/postgresql/1.10.0/1.10.0.sql @@ -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); diff --git a/scripts/schema/db/init_dbs/postgresql/init_schema.sql b/scripts/schema/db/init_dbs/postgresql/init_schema.sql index 9e1427f2a..89d315f15 100644 --- a/scripts/schema/db/init_dbs/postgresql/init_schema.sql +++ b/scripts/schema/db/init_dbs/postgresql/init_schema.sql @@ -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