-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sql
39 lines (33 loc) · 894 Bytes
/
init.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
-- create db
CREATE USER ppstats WITH PASSWORD '----';
CREATE DATABASE ppstats OWNER ppstats;
GRANT ALL PRIVILEGES ON DATABASE ppstats to ppstats;
GRANT ALL ON SCHEMA public TO ppstats;
-- create tables
create table visit_log(
id SERIAL PRIMARY KEY,
app_id varchar(100),
req_host varchar(500),
req_path varchar(1024),
remote_ip varchar(100),
status varchar(50),
created_date timestamp not null default CURRENT_TIMESTAMP,
modified_date timestamp,
req_url varchar(1024),
user_agent varchar(1024)
);
create table reg_application(
id SERIAL PRIMARY KEY,
app_id varchar(100),
name varchar(100),
description varchar(2048),
status varchar(50),
created_date timestamp not null default CURRENT_TIMESTAMP,
modified_date timestamp
);
create table allow_hosts (
id SERIAL PRIMARY KEY,
app_id varchar(100),
host varchar(200),
status varchar(50)
);