-
Notifications
You must be signed in to change notification settings - Fork 179
/
pgw.sql
executable file
·56 lines (56 loc) · 2.23 KB
/
pgw.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
CREATE TABLE `agw_api` (
`id` int(11) NOT NULL,
`service_id` int(11) DEFAULT NULL,
`request_uri` varchar(64) DEFAULT NULL,
`original_uri` varchar(64) DEFAULT NULL,
`description` varchar(128) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `agw_api` (`id`, `service_id`, `request_uri`, `original_uri`, `description`) VALUES
(1, 1, '/', '/', 'all request map');
CREATE TABLE `agw_domain` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `agw_domain` (`id`, `name`) VALUES
(1, 'localhost');
CREATE TABLE `agw_server` (
`id` int(11) NOT NULL,
`service_id` int(11) DEFAULT NULL,
`ip` varchar(64) DEFAULT NULL,
`port` int(11) DEFAULT NULL,
`protocol` varchar(32) NOT NULL DEFAULT 'https://',
`weight` int(11) DEFAULT NULL,
`status` tinyint(1) DEFAULT '1',
`description` varchar(255) DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `agw_server` (`id`, `service_id`, `ip`, `port`, `protocol`, `weight`, `status`, `description`) VALUES
(1, 1, '127.0.0.1', 8081, 'https://', 1, 1, 'proxygateway management');
CREATE TABLE `agw_service` (
`id` int(11) NOT NULL,
`domain_id` int(11) NOT NULL,
`name` varchar(64) DEFAULT NULL,
`host` varchar(255) NOT NULL DEFAULT '',
`description` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `agw_service` (`id`, `domain_id`, `name`, `host`, `description`) VALUES
(1, 1, 'default', 'localhost', 'default proxy configuration');
ALTER TABLE `agw_api`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `service_id` (`service_id`,`request_uri`),
ADD KEY `service_id_2` (`service_id`);
ALTER TABLE `agw_domain`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`);
ALTER TABLE `agw_server`
ADD PRIMARY KEY (`id`);
ALTER TABLE `agw_service`
ADD PRIMARY KEY (`id`),
ADD KEY `domain_id` (`domain_id`);
ALTER TABLE `agw_api`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `agw_domain`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `agw_server`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `agw_service`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;