From bd2bcd378bda7fad15d9ce10cee6c24481fb669c Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 31 Oct 2023 15:29:11 +0100 Subject: [PATCH] change(assist-stats): moved to ee --- .../db/init_dbs/postgresql/1.15.0/1.15.0.sql | 6 ++-- .../db/init_dbs/postgresql/init_schema.sql | 6 ++-- .../db/init_dbs/postgresql/postgresql.iml | 9 ++++++ .../db/init_dbs/postgresql/1.15.0/1.15.0.sql | 31 ------------------- .../db/init_dbs/postgresql/init_schema.sql | 29 ----------------- 5 files changed, 13 insertions(+), 68 deletions(-) create mode 100644 ee/scripts/schema/db/init_dbs/postgresql/postgresql.iml diff --git a/ee/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql b/ee/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql index 966d87cc5..74159fab7 100644 --- a/ee/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql +++ b/ee/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql @@ -128,11 +128,9 @@ CREATE TABLE IF NOT EXISTS public.assist_events project_id integer NOT NULL, session_id varchar NOT NULL, event_type varchar NOT NULL, - event_state varchar NOT NULL, - timestamp integer NOT NULL, - user_id varchar, + timestamp bigint NOT NULL, duration integer, - agent_id varchar + agent_id integer ); CREATE TABLE IF NOT EXISTS public.assist_events_aggregates 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 6af6d9517..724af507a 100644 --- a/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql +++ b/ee/scripts/schema/db/init_dbs/postgresql/init_schema.sql @@ -977,11 +977,9 @@ $$ project_id integer NOT NULL, session_id varchar NOT NULL, event_type varchar NOT NULL, - event_state varchar NOT NULL, - timestamp integer NOT NULL, - user_id varchar, + timestamp bigint NOT NULL, duration integer, - agent_id varchar + agent_id integer ); CREATE TABLE IF NOT EXISTS public.assist_events_aggregates diff --git a/ee/scripts/schema/db/init_dbs/postgresql/postgresql.iml b/ee/scripts/schema/db/init_dbs/postgresql/postgresql.iml new file mode 100644 index 000000000..8021953ed --- /dev/null +++ b/ee/scripts/schema/db/init_dbs/postgresql/postgresql.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql b/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql index f4882c87c..66c6ba944 100644 --- a/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql +++ b/scripts/schema/db/init_dbs/postgresql/1.15.0/1.15.0.sql @@ -121,37 +121,6 @@ ALTER TABLE IF EXISTS events.clicks ALTER TABLE IF EXISTS public.metrics ADD COLUMN IF NOT EXISTS card_info jsonb NULL; - -CREATE TABLE IF NOT EXISTS public.assist_events -( - event_id varchar NOT NULL PRIMARY KEY, - project_id integer NOT NULL, - session_id varchar NOT NULL, - event_type varchar NOT NULL, - timestamp bigint NOT NULL, - duration integer, - agent_id integer -); - -CREATE TABLE IF NOT EXISTS public.assist_events_aggregates -( - timestamp BIGINT not null, - project_id integer not null, - agent_id integer not null, - assist_avg BIGINT, - call_avg BIGINT, - control_avg BIGINT, - assist_total BIGINT, - call_total BIGINT, - control_total BIGINT -); - - -CREATE TABLE IF NOT EXISTS public.assist_events_aggregates_logs -( - time BIGINT not null -); - ALTER TABLE IF EXISTS public.users ADD COLUMN IF NOT EXISTS settings jsonb DEFAULT NULL; diff --git a/scripts/schema/db/init_dbs/postgresql/init_schema.sql b/scripts/schema/db/init_dbs/postgresql/init_schema.sql index 9384f7318..f80545d2b 100644 --- a/scripts/schema/db/init_dbs/postgresql/init_schema.sql +++ b/scripts/schema/db/init_dbs/postgresql/init_schema.sql @@ -1116,35 +1116,6 @@ $$ CREATE INDEX swipes_timestamp_idx ON events_ios.swipes (timestamp); CREATE INDEX swipes_label_session_id_timestamp_idx ON events_ios.swipes (label, session_id, timestamp); - CREATE TABLE IF NOT EXISTS public.assist_events - ( - event_id varchar NOT NULL PRIMARY KEY, - project_id integer NOT NULL, - session_id varchar NOT NULL, - event_type varchar NOT NULL, - timestamp bigint NOT NULL, - duration integer, - agent_id integer - ); - - CREATE TABLE IF NOT EXISTS public.assist_events_aggregates - ( - timestamp BIGINT not null, - project_id integer not null, - agent_id integer not null, - assist_avg BIGINT, - call_avg BIGINT, - control_avg BIGINT, - assist_total BIGINT, - call_total BIGINT, - control_total BIGINT - ); - - CREATE TABLE IF NOT EXISTS public.assist_events_aggregates_logs - ( - time BIGINT not null - ); - raise notice 'DB created'; END IF; END;