feat(api): requests change base_path to path
feat(db): requests change base_path to path
This commit is contained in:
parent
320279a818
commit
d472e20948
4 changed files with 51 additions and 57 deletions
|
|
@ -341,7 +341,7 @@ class event_type:
|
||||||
INPUT = Event(ui_type=schemas.EventType.input, table="events.inputs", column="label")
|
INPUT = Event(ui_type=schemas.EventType.input, table="events.inputs", column="label")
|
||||||
LOCATION = Event(ui_type=schemas.EventType.location, table="events.pages", column="base_path")
|
LOCATION = Event(ui_type=schemas.EventType.location, table="events.pages", column="base_path")
|
||||||
CUSTOM = Event(ui_type=schemas.EventType.custom, table="events_common.customs", column="name")
|
CUSTOM = Event(ui_type=schemas.EventType.custom, table="events_common.customs", column="name")
|
||||||
REQUEST = Event(ui_type=schemas.EventType.request, table="events_common.requests", column="base_path")
|
REQUEST = Event(ui_type=schemas.EventType.request, table="events_common.requests", column="path")
|
||||||
GRAPHQL = Event(ui_type=schemas.EventType.graphql, table="events.graphql", column="name")
|
GRAPHQL = Event(ui_type=schemas.EventType.graphql, table="events.graphql", column="name")
|
||||||
STATEACTION = Event(ui_type=schemas.EventType.state_action, table="events.state_actions", column="name")
|
STATEACTION = Event(ui_type=schemas.EventType.state_action, table="events.state_actions", column="name")
|
||||||
ERROR = Event(ui_type=schemas.EventType.error, table="events.errors",
|
ERROR = Event(ui_type=schemas.EventType.error, table="events.errors",
|
||||||
|
|
|
||||||
|
|
@ -100,38 +100,36 @@ $$ LANGUAGE plpgsql;
|
||||||
DO
|
DO
|
||||||
$$
|
$$
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (with to_check (name) as (
|
IF (with to_check (name) as (values ('alerts'),
|
||||||
values ('alerts'),
|
('announcements'),
|
||||||
('announcements'),
|
('assigned_sessions'),
|
||||||
('assigned_sessions'),
|
('autocomplete'),
|
||||||
('autocomplete'),
|
('basic_authentication'),
|
||||||
('basic_authentication'),
|
('dashboards'),
|
||||||
('dashboards'),
|
('dashboard_widgets'),
|
||||||
('dashboard_widgets'),
|
('errors'),
|
||||||
('errors'),
|
('funnels'),
|
||||||
('funnels'),
|
('integrations'),
|
||||||
('integrations'),
|
('issues'),
|
||||||
('issues'),
|
('jira_cloud'),
|
||||||
('jira_cloud'),
|
('jobs'),
|
||||||
('jobs'),
|
('metric_series'),
|
||||||
('metric_series'),
|
('metrics'),
|
||||||
('metrics'),
|
('notifications'),
|
||||||
('notifications'),
|
('oauth_authentication'),
|
||||||
('oauth_authentication'),
|
('projects'),
|
||||||
('projects'),
|
('roles'),
|
||||||
('roles'),
|
('roles_projects'),
|
||||||
('roles_projects'),
|
('searches'),
|
||||||
('searches'),
|
('sessions'),
|
||||||
('sessions'),
|
('tenants'),
|
||||||
('tenants'),
|
('traces'),
|
||||||
('traces'),
|
('user_favorite_errors'),
|
||||||
('user_favorite_errors'),
|
('user_favorite_sessions'),
|
||||||
('user_favorite_sessions'),
|
('user_viewed_errors'),
|
||||||
('user_viewed_errors'),
|
('user_viewed_sessions'),
|
||||||
('user_viewed_sessions'),
|
('users'),
|
||||||
('users'),
|
('webhooks'))
|
||||||
('webhooks')
|
|
||||||
)
|
|
||||||
select bool_and(exists(select *
|
select bool_and(exists(select *
|
||||||
from information_schema.tables t
|
from information_schema.tables t
|
||||||
where table_schema = 'public'
|
where table_schema = 'public'
|
||||||
|
|
@ -914,16 +912,14 @@ LANGUAGE plpgsql;
|
||||||
DO
|
DO
|
||||||
$$
|
$$
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (with to_check (name) as (
|
IF (with to_check (name) as (values ('clicks'),
|
||||||
values ('clicks'),
|
('errors'),
|
||||||
('errors'),
|
('graphql'),
|
||||||
('graphql'),
|
('inputs'),
|
||||||
('inputs'),
|
('pages'),
|
||||||
('pages'),
|
('performance'),
|
||||||
('performance'),
|
('resources'),
|
||||||
('resources'),
|
('state_actions'))
|
||||||
('state_actions')
|
|
||||||
)
|
|
||||||
select bool_and(exists(select *
|
select bool_and(exists(select *
|
||||||
from information_schema.tables t
|
from information_schema.tables t
|
||||||
where table_schema = 'events'
|
where table_schema = 'events'
|
||||||
|
|
@ -1176,11 +1172,9 @@ LANGUAGE plpgsql;
|
||||||
DO
|
DO
|
||||||
$$
|
$$
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (with to_check (name) as (
|
IF (with to_check (name) as (values ('customs'),
|
||||||
values ('customs'),
|
('issues'),
|
||||||
('issues'),
|
('requests'))
|
||||||
('requests')
|
|
||||||
)
|
|
||||||
select bool_and(exists(select *
|
select bool_and(exists(select *
|
||||||
from information_schema.tables t
|
from information_schema.tables t
|
||||||
where table_schema = 'events_common'
|
where table_schema = 'events_common'
|
||||||
|
|
@ -1238,7 +1232,7 @@ $$
|
||||||
status_code smallint NULL,
|
status_code smallint NULL,
|
||||||
method http_method NULL,
|
method http_method NULL,
|
||||||
host text NULL,
|
host text NULL,
|
||||||
base_path text NULL,
|
path text NULL,
|
||||||
query text NULL,
|
query text NULL,
|
||||||
PRIMARY KEY (session_id, timestamp, seq_index)
|
PRIMARY KEY (session_id, timestamp, seq_index)
|
||||||
);
|
);
|
||||||
|
|
@ -1263,8 +1257,8 @@ $$
|
||||||
CREATE INDEX IF NOT EXISTS requests_status_code_nn_idx ON events_common.requests (status_code) WHERE status_code IS NOT NULL;
|
CREATE INDEX IF NOT EXISTS requests_status_code_nn_idx ON events_common.requests (status_code) WHERE status_code IS NOT NULL;
|
||||||
CREATE INDEX IF NOT EXISTS requests_host_nn_idx ON events_common.requests (host) WHERE host IS NOT NULL;
|
CREATE INDEX IF NOT EXISTS requests_host_nn_idx ON events_common.requests (host) WHERE host IS NOT NULL;
|
||||||
CREATE INDEX IF NOT EXISTS requests_host_nn_gin_idx ON events_common.requests USING GIN (host gin_trgm_ops) WHERE host IS NOT NULL;
|
CREATE INDEX IF NOT EXISTS requests_host_nn_gin_idx ON events_common.requests USING GIN (host gin_trgm_ops) WHERE host IS NOT NULL;
|
||||||
CREATE INDEX IF NOT EXISTS requests_base_path_nn_idx ON events_common.requests (base_path) WHERE base_path IS NOT NULL;
|
CREATE INDEX IF NOT EXISTS requests_path_nn_idx ON events_common.requests (path) WHERE path IS NOT NULL;
|
||||||
CREATE INDEX IF NOT EXISTS requests_base_path_nn_gin_idx ON events_common.requests USING GIN (base_path gin_trgm_ops) WHERE base_path IS NOT NULL;
|
CREATE INDEX IF NOT EXISTS requests_path_nn_gin_idx ON events_common.requests USING GIN (path gin_trgm_ops) WHERE path IS NOT NULL;
|
||||||
CREATE INDEX IF NOT EXISTS requests_query_nn_idx ON events_common.requests (query) WHERE query IS NOT NULL;
|
CREATE INDEX IF NOT EXISTS requests_query_nn_idx ON events_common.requests (query) WHERE query IS NOT NULL;
|
||||||
CREATE INDEX IF NOT EXISTS requests_query_nn_gin_idx ON events_common.requests USING GIN (query gin_trgm_ops) WHERE query IS NOT NULL;
|
CREATE INDEX IF NOT EXISTS requests_query_nn_gin_idx ON events_common.requests USING GIN (query gin_trgm_ops) WHERE query IS NOT NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS dashboard_widgets
|
||||||
|
|
||||||
ALTER TABLE events_common.requests
|
ALTER TABLE events_common.requests
|
||||||
ADD COLUMN IF NOT EXISTS host text NULL,
|
ADD COLUMN IF NOT EXISTS host text NULL,
|
||||||
ADD COLUMN IF NOT EXISTS base_path text NULL,
|
ADD COLUMN IF NOT EXISTS path text NULL,
|
||||||
ADD COLUMN IF NOT EXISTS query text NULL;
|
ADD COLUMN IF NOT EXISTS query text NULL;
|
||||||
|
|
||||||
ALTER TABLE events.pages
|
ALTER TABLE events.pages
|
||||||
|
|
@ -312,8 +312,8 @@ ON CONFLICT (predefined_key) DO UPDATE
|
||||||
|
|
||||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_host_nn_idx ON events_common.requests (host) WHERE host IS NOT NULL;
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_host_nn_idx ON events_common.requests (host) WHERE host IS NOT NULL;
|
||||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_host_nn_gin_idx ON events_common.requests USING GIN (host gin_trgm_ops) WHERE host IS NOT NULL;
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_host_nn_gin_idx ON events_common.requests USING GIN (host gin_trgm_ops) WHERE host IS NOT NULL;
|
||||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_base_path_nn_idx ON events_common.requests (base_path) WHERE base_path IS NOT NULL;
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_path_nn_idx ON events_common.requests (path) WHERE path IS NOT NULL;
|
||||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_base_path_nn_gin_idx ON events_common.requests USING GIN (base_path gin_trgm_ops) WHERE base_path IS NOT NULL;
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_path_nn_gin_idx ON events_common.requests USING GIN (path gin_trgm_ops) WHERE path IS NOT NULL;
|
||||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_query_nn_idx ON events_common.requests (query) WHERE query IS NOT NULL;
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_query_nn_idx ON events_common.requests (query) WHERE query IS NOT NULL;
|
||||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_query_nn_gin_idx ON events_common.requests USING GIN (query gin_trgm_ops) WHERE query IS NOT NULL;
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS requests_query_nn_gin_idx ON events_common.requests USING GIN (query gin_trgm_ops) WHERE query IS NOT NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -646,7 +646,7 @@ $$
|
||||||
status_code smallint NULL,
|
status_code smallint NULL,
|
||||||
method http_method NULL,
|
method http_method NULL,
|
||||||
host text NULL,
|
host text NULL,
|
||||||
base_path text NULL,
|
path text NULL,
|
||||||
query text NULL,
|
query text NULL,
|
||||||
PRIMARY KEY (session_id, timestamp, seq_index)
|
PRIMARY KEY (session_id, timestamp, seq_index)
|
||||||
);
|
);
|
||||||
|
|
@ -669,8 +669,8 @@ $$
|
||||||
CREATE INDEX requests_status_code_nn_idx ON events_common.requests (status_code) WHERE status_code IS NOT NULL;
|
CREATE INDEX requests_status_code_nn_idx ON events_common.requests (status_code) WHERE status_code IS NOT NULL;
|
||||||
CREATE INDEX requests_host_nn_idx ON events_common.requests (host) WHERE host IS NOT NULL;
|
CREATE INDEX requests_host_nn_idx ON events_common.requests (host) WHERE host IS NOT NULL;
|
||||||
CREATE INDEX requests_host_nn_gin_idx ON events_common.requests USING GIN (host gin_trgm_ops) WHERE host IS NOT NULL;
|
CREATE INDEX requests_host_nn_gin_idx ON events_common.requests USING GIN (host gin_trgm_ops) WHERE host IS NOT NULL;
|
||||||
CREATE INDEX requests_base_path_nn_idx ON events_common.requests (base_path) WHERE base_path IS NOT NULL;
|
CREATE INDEX requests_path_nn_idx ON events_common.requests (path) WHERE path IS NOT NULL;
|
||||||
CREATE INDEX requests_base_path_nn_gin_idx ON events_common.requests USING GIN (base_path gin_trgm_ops) WHERE base_path IS NOT NULL;
|
CREATE INDEX requests_path_nn_gin_idx ON events_common.requests USING GIN (path gin_trgm_ops) WHERE path IS NOT NULL;
|
||||||
CREATE INDEX requests_query_nn_idx ON events_common.requests (query) WHERE query IS NOT NULL;
|
CREATE INDEX requests_query_nn_idx ON events_common.requests (query) WHERE query IS NOT NULL;
|
||||||
CREATE INDEX requests_query_nn_gin_idx ON events_common.requests USING GIN (query gin_trgm_ops) WHERE query IS NOT NULL;
|
CREATE INDEX requests_query_nn_gin_idx ON events_common.requests USING GIN (query gin_trgm_ops) WHERE query IS NOT NULL;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue