-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_db.sql
More file actions
35 lines (30 loc) · 732 Bytes
/
init_db.sql
File metadata and controls
35 lines (30 loc) · 732 Bytes
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
CREATE DATABASE net_port;
\c net_port
CREATE TABLE role (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL UNIQUE,
description TEXT
);
CREATE TABLE servers (
user_id INTEGER,
input_port INTEGER,
output_port INTEGER,
enable BOOLEAN,
enable_ssl BOOLEAN,
enable_input_ssl BOOLEAN
);
CREATE TABLE statistic (
id SERIAL PRIMARY KEY,
server_id INTEGER,
bytes_received BIGINT DEFAULT 0,
bytes_sent BIGINT DEFAULT 0,
connections_count INTEGER DEFAULT 0,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE users (
id SERIAL PRIMARY KEY,
login VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
email VARCHAR(255),
role_name VARCHAR(255),
);