forked from sbilly/docker-zerotier-controller
-
Notifications
You must be signed in to change notification settings - Fork 4
/
createTables.sql
128 lines (118 loc) · 2.95 KB
/
createTables.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
DROP TABLE ztc_database;
CREATE TABLE ztc_database (
version integer
);
INSERT INTO ztc_database VALUES (5);
SELECT * FROM ztc_database;
DROP TABLE ztc_network;
CREATE TABLE ztc_network (
id text UNIQUE,
creation_time timestamp,
owner_id text,
capabilities text,
enable_broadcast BOOLEAN NOT NULL DEFAULT TRUE,
last_modified timestamp,
mtu text,
multicast_limit text,
name text,
private BOOLEAN NOT NULL DEFAULT TRUE,
remote_trace_level text,
remote_trace_target text,
revision integer,
rules text,
rules_source text,
tags text,
v4_assign_mode text,
v6_assign_mode text,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
controller_id text
);
SELECT * FROM ztc_network;
DROP TABLE ztc_member;
CREATE TABLE ztc_member (
id text,
network_id text,
active_bridge BOOLEAN NOT NULL DEFAULT FALSE,
authorized BOOLEAN NOT NULL DEFAULT FALSE,
capabilities text,
identity text,
last_authorized_time timestamp,
last_deauthorized_time timestamp,
no_auto_assign_ips BOOLEAN NOT NULL DEFAULT FALSE,
remote_trace_level text,
remote_trace_target text,
revision integer,
tags text,
v_major text,
v_minor text,
v_rev text,
v_proto text,
creation_time timestamp,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
hidden BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE UNIQUE INDEX on ztc_member (network_id, id);
SELECT * FROM ztc_member;
DROP TABLE ztc_controller;
CREATE TABLE ztc_controller (
id text UNIQUE,
cluster_host text,
last_alive timestamp,
public_identity text,
v_major text,
v_minor text,
v_rev text,
v_proto text,
v_build text,
host_port text,
use_redis text
);
SELECT * FROM ztc_controller;
DROP TABLE ztc_global_permissions;
CREATE TABLE ztc_global_permissions (
user_id text,
authorize boolean,
del boolean,
modify boolean,
read boolean
);
SELECT * FROM ztc_global_permissions;
DROP TABLE ztc_network_assignment_pool;
CREATE TABLE ztc_network_assignment_pool (
network_id text,
ip_range_start inet,
ip_range_end inet
);
SELECT * FROM ztc_network_assignment_pool;
DROP TABLE ztc_network_route;
CREATE TABLE ztc_network_route (
network_id text,
address inet,
bits text,
via inet
);
SELECT * FROM ztc_network_route;
DROP TABLE ztc_network_dns;
CREATE TABLE ztc_network_dns (
network_id text,
domain text,
servers text
);
SELECT * FROM ztc_network_dns;
DROP TABLE ztc_member_ip_assignment;
CREATE TABLE ztc_member_ip_assignment (
network_id text,
member_id text,
address inet
);
CREATE UNIQUE INDEX on ztc_member_ip_assignment (network_id, member_id, address);
SELECT * FROM ztc_member_ip_assignment;
DROP TABLE ztc_member_status;
CREATE TABLE ztc_member_status (
network_id text,
member_id text,
address inet,
last_updated text
);
CREATE UNIQUE INDEX on ztc_member_status (network_id, member_id);
SELECT * FROM ztc_member_status;