-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_database.sql
41 lines (37 loc) · 1.47 KB
/
create_database.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
CREATE DATABASE ipfs_content_location;
\c ipfs_content_location
Create TABLE requests (
req_id bytea primary key,
timestamp TIMESTAMP not null,
cid VARCHAR(100) not null,
continent char(2),
country char(2),
region varchar(5),
lat float,
long float,
asn int,
aso text,
request_time float,
upstream_time float,
body_bytes bigint,
user_agent text,
cache text,
status int,
host text
);
Create TABLE providers (
cid VARCHAR(100) not null,
continent char(2),
country char(2),
region varchar(5),
lat float,
long float,
asn int,
aso text,
request_time float,
peerID varchar(100),
found_at timestamp,
updated_at timestamp,
primary key (cid, peerID)
);
create index requests_timestamp_idx on requests(timestamp);