-
Notifications
You must be signed in to change notification settings - Fork 1
/
initialize.sql
74 lines (65 loc) · 1.69 KB
/
initialize.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
CREATE TABLE
IF NOT EXISTS nodeTypes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(50) NOT NULL UNIQUE,
description TEXT,
priorityClass INTEGER NOT NULL DEFAULT 0
);
CREATE TABLE
IF NOT EXISTS nodeLinks (
childNodeId INTEGER PRIMARY KEY,
parentNodeId INTEGER NOT NULL,
FOREIGN KEY (childNodeId) REFERENCES nodes (id),
FOREIGN KEY (parentNodeId) REFERENCES nodes (id)
);
CREATE TABLE
IF NOT EXISTS nodes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(50) NOT NULL UNIQUE,
description TEXT,
type INTEGER,
httpVisible INTEGER NOT NULL DEFAULT 1,
httpUrl TEXT NOT NULL,
httpStatus INTEGER NOT NULL DEFAULT 0,
FOREIGN KEY (type) REFERENCES nodeTypes (id)
);
INSERT INTO
nodeTypes (name, description)
VALUES
(
'Infrastructure',
'Lorem ipsum odor amet, consectetuer adipiscing elit.'
);
INSERT INTO
nodes (name, description, type, httpUrl)
VALUES
(
'Example Server',
'Lorem ipsum odor amet, consectetuer adipiscing elit.',
1,
'https://example.com'
);
INSERT INTO
nodes (name, type, httpUrl)
VALUES
('Error Server', 1, 'https://example.com/test404');
INSERT INTO
nodes (name, httpUrl)
VALUES
('Example Service', 'https://example.org');
INSERT INTO
nodes (name, description, httpUrl)
VALUES
(
'Error Service',
'Lorem ipsum odor amet, consectetuer adipiscing elit.',
'https://example.org/test404'
);
INSERT INTO
nodeLinks (childNodeId, parentNodeId)
VALUES
(3, 1);
INSERT INTO
nodeLinks (childNodeId, parentNodeId)
VALUES
(4, 1);