From 32a6ae5d59f9341f9501a951659afe462bcf0684 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 24 Oct 2023 17:41:45 +0200 Subject: [PATCH] fix(db): sql script of assist stats --- .../db/init_dbs/postgresql/1.15.0/1.15.0.sql | 2 +- .../db/init_dbs/postgresql/init_schema.sql | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) 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 01d1f08cf..ca43e218f 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 @@ -148,7 +148,7 @@ CREATE TABLE IF NOT EXISTS public.assist_events_aggregates ); -CREATE TABLE IF NOT EXISTS pulic.assist_events_aggregates_logs +CREATE TABLE IF NOT EXISTS public.assist_events_aggregates_logs ( time BIGINT not null ); diff --git a/scripts/schema/db/init_dbs/postgresql/init_schema.sql b/scripts/schema/db/init_dbs/postgresql/init_schema.sql index 642084d90..3d38ece19 100644 --- a/scripts/schema/db/init_dbs/postgresql/init_schema.sql +++ b/scripts/schema/db/init_dbs/postgresql/init_schema.sql @@ -1112,6 +1112,37 @@ $$ 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, + event_state varchar NOT NULL, + timestamp integer NOT NULL, + user_id varchar, + agent_id varchar + ); + + 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;