-
Notifications
You must be signed in to change notification settings - Fork 3
/
db.sql
112 lines (104 loc) · 4.01 KB
/
db.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
-- MySQL Workbench Synchronization
-- Generated: 2019-01-30 11:36
-- Model: New Model
-- Version: 1.0
-- Project: Name of the project
-- Author: Floris
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE TABLE IF NOT EXISTS `sites` (
`idsites` INT(11) NOT NULL AUTO_INCREMENT,
`name` TEXT NULL DEFAULT NULL,
`unifiid` TEXT NULL DEFAULT NULL,
`usg` TINYINT(1) NULL DEFAULT NULL,
`wan1` TEXT NULL DEFAULT NULL,
`wan1interface` TEXT NULL DEFAULT NULL,
`wan2` TEXT NULL DEFAULT NULL,
`wan2interface` TEXT NULL DEFAULT NULL,
`bgp` TINYINT(1) NULL DEFAULT NULL,
`bgprouterid` TEXT NULL DEFAULT NULL,
`bgpas` INT(11) NULL DEFAULT NULL,
`igmpupstream` TINYINT(1) NULL DEFAULT NULL,
`igmpupstreamaltsubnet` TEXT NULL DEFAULT NULL,
`dnsredirect` TINYINT(1) NULL DEFAULT NULL,
`dnsredirectip` TEXT NULL DEFAULT NULL,
`dnsridirectinterface` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`idsites`),
UNIQUE INDEX `idsites_UNIQUE` (`idsites` ASC))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE TABLE IF NOT EXISTS `vpnsitesother` (
`idvpnsitesother` INT(11) NOT NULL AUTO_INCREMENT,
`bgprouterid` TEXT NULL DEFAULT NULL,
`bgpas` INT(11) NULL DEFAULT NULL,
`secret` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`idvpnsitesother`),
UNIQUE INDEX `idvpnsitesother_UNIQUE` (`idvpnsitesother` ASC))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE TABLE IF NOT EXISTS `vpnconnectionsunifi` (
`idvpnconnections` INT(11) NOT NULL AUTO_INCREMENT,
`site1` INT(11) NOT NULL,
`site2` INT(11) NOT NULL,
`secret` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`idvpnconnections`),
UNIQUE INDEX `idvpnconnections_UNIQUE` (`idvpnconnections` ASC),
INDEX `fk_vpnconnectionsunifi_sites_idx` (`site1` ASC),
INDEX `fk_vpnconnectionsunifi_sites1_idx` (`site2` ASC),
CONSTRAINT `fk_vpnconnectionsunifi_sites`
FOREIGN KEY (`site1`)
REFERENCES `sites` (`idsites`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_vpnconnectionsunifi_sites1`
FOREIGN KEY (`site2`)
REFERENCES `sites` (`idsites`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE TABLE IF NOT EXISTS `vpnconnectionsother` (
`idvpnconnectionsother` INT(11) NOT NULL AUTO_INCREMENT,
`site1` INT(11) NOT NULL,
`site2` INT(11) NOT NULL,
PRIMARY KEY (`idvpnconnectionsother`),
UNIQUE INDEX `idvpnconnectionsother_UNIQUE` (`idvpnconnectionsother` ASC),
INDEX `fk_vpnconnectionsother_sites1_idx` (`site1` ASC),
INDEX `fk_vpnconnectionsother_vpnsitesother1_idx` (`site2` ASC),
CONSTRAINT `fk_vpnconnectionsother_sites1`
FOREIGN KEY (`site1`)
REFERENCES `sites` (`idsites`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_vpnconnectionsother_vpnsitesother1`
FOREIGN KEY (`site2`)
REFERENCES `vpnsitesother` (`idvpnsitesother`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE TABLE IF NOT EXISTS `sitesubnets` (
`idsitesubnets` INT(11) NOT NULL AUTO_INCREMENT,
`name` TEXT NULL DEFAULT NULL,
`subnet` TEXT NULL DEFAULT NULL,
`inbgp` TINYINT(1) NULL DEFAULT NULL,
`site` INT(11) NOT NULL,
`interface` TEXT NULL DEFAULT NULL,
`igmpupstream` TINYINT(1) NULL DEFAULT NULL,
`igmpdownstream` TINYINT(1) NULL DEFAULT NULL,
`dnsredirect` TINYINT(1) NULL DEFAULT NULL,
`mdnsrepeater` TINYINT(1) NULL DEFAULT NULL,
PRIMARY KEY (`idsitesubnets`),
UNIQUE INDEX `idsitesubnets_UNIQUE` (`idsitesubnets` ASC),
INDEX `fk_sitesubnets_sites1_idx` (`site` ASC),
CONSTRAINT `fk_sitesubnets_sites1`
FOREIGN KEY (`site`)
REFERENCES `sites` (`idsites`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;