fix(db): sql script of assist stats

This commit is contained in:
Shekar Siri 2023-10-24 17:41:45 +02:00
parent de2faa7fbd
commit 32a6ae5d59
2 changed files with 32 additions and 1 deletions

View file

@ -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
);

View file

@ -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;