forked from jbonicioli/Live-BGP-Statistics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_schema.sql
100 lines (90 loc) · 3.42 KB
/
db_schema.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
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
DROP TABLE IF EXISTS `cclass`;
CREATE TABLE IF NOT EXISTS `cclass` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`CClass` varchar(19) NOT NULL,
`Node_id` int(10) NOT NULL,
`state` enum('up','down') NOT NULL,
`date` int(10) NOT NULL,
`Seenby` int(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `Node_id` (`Node_id`),
KEY `state` (`state`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
DROP TABLE IF EXISTS `cclass_temp`;
CREATE TABLE IF NOT EXISTS `cclass_temp` (
`id` bigint(10) NOT NULL AUTO_INCREMENT,
`Node_id` int(5) NOT NULL,
`CClass` varchar(19) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `node1` (`Node_id`,`CClass`),
KEY `node1_2` (`Node_id`),
KEY `node2` (`CClass`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
DROP TABLE IF EXISTS `links`;
CREATE TABLE IF NOT EXISTS `links` (
`id` bigint(10) NOT NULL AUTO_INCREMENT,
`node1` int(10) NOT NULL DEFAULT '0',
`node2` int(10) NOT NULL DEFAULT '0',
`date` int(10) NOT NULL DEFAULT '0',
`state` enum('up','down') NOT NULL DEFAULT 'up',
`active` enum('0','1') NOT NULL DEFAULT '0',
`byrouter` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `node1` (`node1`,`node2`),
KEY `node1_2` (`node1`),
KEY `node2` (`node2`),
KEY `state` (`state`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
DROP TABLE IF EXISTS `links_temp`;
CREATE TABLE IF NOT EXISTS `links_temp` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`node1` int(10) NOT NULL,
`node2` int(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_nodes` (`node1`,`node2`),
KEY `node1` (`node1`),
KEY `node2` (`node2`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
DROP TABLE IF EXISTS `nodes`;
CREATE TABLE IF NOT EXISTS `nodes` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`Node_id` int(10) NOT NULL DEFAULT '0',
`Node_name` varchar(255) NOT NULL DEFAULT '',
`Node_area` varchar(255) NOT NULL DEFAULT '',
`lat` varchar(255) NOT NULL DEFAULT '',
`lon` varchar(255) NOT NULL DEFAULT '',
`C-Class` varchar(255) NOT NULL,
`Owner` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `Node_id` (`Node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
DROP TABLE IF EXISTS `prepends`;
CREATE TABLE IF NOT EXISTS `prepends` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`nodeid` int(10) NOT NULL DEFAULT '0',
`parent_nodeid` varchar(255) NOT NULL DEFAULT '0',
`date` int(10) NOT NULL,
`state` enum('up','down') NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nodeid` (`nodeid`,`parent_nodeid`),
KEY `date` (`date`,`state`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
DROP TABLE IF EXISTS `prepends_temp`;
CREATE TABLE IF NOT EXISTS `prepends_temp` (
`id` bigint(10) NOT NULL AUTO_INCREMENT,
`nodeid` int(10) NOT NULL,
`parent_nodeid` int(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `node1` (`nodeid`,`parent_nodeid`),
KEY `node1_2` (`nodeid`),
KEY `node2` (`parent_nodeid`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;