Updated pirsch and added country statistics to tracking page.

This commit is contained in:
Marvin Blum
2020-09-20 13:38:43 +02:00
committed by Marvin Blum
parent 388997a678
commit b6e14ed1aa
9 changed files with 104 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
ALTER TABLE "hit" ADD COLUMN "country_code" character varying(2);
CREATE TABLE "country_stats" (
id bigint NOT NULL UNIQUE,
tenant_id bigint,
day date NOT NULL,
visitors integer NOT NULL,
country_code character varying(2)
);
CREATE SEQUENCE country_stats_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE country_stats_id_seq OWNED BY "country_stats".id;
ALTER TABLE ONLY "country_stats" ALTER COLUMN id SET DEFAULT nextval('country_stats_id_seq'::regclass);
ALTER TABLE ONLY "country_stats" ADD CONSTRAINT country_stats_pkey PRIMARY KEY (id);
CREATE INDEX country_stats_day_index ON country_stats(day);