Skip to content

Commit ddc22fb

Browse files
authored
Merge pull request #183 from UW-Macrostrat/stats-schema
Usage stats schema
2 parents b4179ba + 92f2411 commit ddc22fb

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
CREATE SCHEMA usage_stats;
2+
3+
CREATE TABLE IF NOT EXISTS usage_stats.rockd_stats (
4+
id serial PRIMARY KEY,
5+
date timestamp with time zone NOT NULL DEFAULT now(),
6+
ip text NOT NULL,
7+
lat float NOT NULL,
8+
lng float NOT NULL,
9+
matomo_id integer NOT NULL
10+
);
11+
12+
CREATE TABLE IF NOT EXISTS usage_stats.macrostrat_stats (
13+
id serial PRIMARY KEY,
14+
date timestamp with time zone NOT NULL DEFAULT now(),
15+
ip text NOT NULL,
16+
lat float NOT NULL,
17+
lng float NOT NULL,
18+
matomo_id integer NOT NULL
19+
);
20+
21+
CREATE TABLE IF NOT EXISTS usage_stats.tileserver_stats (
22+
req_id serial PRIMARY KEY,
23+
uri text NOT NULL,
24+
layer text NOT NULL,
25+
ext text NOT NULL,
26+
x integer NOT NULL,
27+
y integer NOT NULL,
28+
z integer NOT NULL,
29+
referrer text NOT NULL,
30+
app text,
31+
app_version text,
32+
cache_hit boolean NOT NULL,
33+
redis_hit boolean NOT NULL,
34+
time timestamp without time zone NOT NULL
35+
);
36+

services/usage-stats/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

0 commit comments

Comments
 (0)