From 480867e65575e6767c0b7670ba04f74e470a5d7c Mon Sep 17 00:00:00 2001 From: Yohanes Date: Wed, 5 Apr 2023 19:52:39 +0800 Subject: [PATCH] =?UTF-8?q?sqlite=E5=88=9D=E5=A7=8B=E5=8C=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=8F=8A=E5=A2=9E=E9=87=8F=E8=84=9A=E6=9C=AC=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=8F=E8=BF=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/sql/mysql/update/UPDATE-20230402.SQL | 3 ++- .../src/main/resources/sql/sqlite/init-structure.sql | 1 + .../main/resources/sql/sqlite/port_mapping.data.sql | 12 ++++++------ .../resources/sql/sqlite/update/UPDATE-20230402.SQL | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20230402.SQL b/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20230402.SQL index 8017105d..2fcdf2bf 100644 --- a/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20230402.SQL +++ b/neutrino-proxy-server/src/main/resources/sql/mysql/update/UPDATE-20230402.SQL @@ -1,2 +1,3 @@ ALTER TABLE port_mapping ADD `protocal` varchar(10) NOT NULL DEFAULT 'TCP' COMMENT '协议'; -ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL COMMENT '子域名(仅HTTP时有效)'; \ No newline at end of file +ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL COMMENT '子域名(仅HTTP时有效)'; +ALTER TABLE port_mapping ADD `description` varchar(100) DEFAULT NULL COMMENT '描述'; \ No newline at end of file diff --git a/neutrino-proxy-server/src/main/resources/sql/sqlite/init-structure.sql b/neutrino-proxy-server/src/main/resources/sql/sqlite/init-structure.sql index 602fbf54..3b2f5924 100644 --- a/neutrino-proxy-server/src/main/resources/sql/sqlite/init-structure.sql +++ b/neutrino-proxy-server/src/main/resources/sql/sqlite/init-structure.sql @@ -69,6 +69,7 @@ CREATE TABLE IF NOT EXISTS `port_mapping` ( `client_ip` VARCHAR(20) NOT NULL, `client_port` INTEGER NOT NULL, `is_online` INTEGER(2) NOT NULL, + `description` VARCHAR(100) DEFAULT NULL, `enable` INTEGER(2) NOT NULL, `create_time` INTEGER(20) NOT NULL, `update_time` INTEGER(20) NOT NULL diff --git a/neutrino-proxy-server/src/main/resources/sql/sqlite/port_mapping.data.sql b/neutrino-proxy-server/src/main/resources/sql/sqlite/port_mapping.data.sql index 2b2847cb..71ebd813 100644 --- a/neutrino-proxy-server/src/main/resources/sql/sqlite/port_mapping.data.sql +++ b/neutrino-proxy-server/src/main/resources/sql/sqlite/port_mapping.data.sql @@ -1,7 +1,7 @@ #port_mapping -INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES -(1, 1, 9101, 'HTTP', 'test1', '127.0.0.1', 8080, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW')); -INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES -(2, 1, 9102, 'TCP', '', '127.0.0.1', 3306, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW')); -INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`, `create_time`, `update_time`) VALUES -(3, 1, 9103, 'HTTP', 'test2', '127.0.0.1', 8081, 2, 1, STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW')); \ No newline at end of file +INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`,`client_ip`, `client_port`, `is_online`, `enable`,`description`,`create_time`, `update_time`) VALUES +(1, 1, 9101, 'HTTP', 'test1', '127.0.0.1', 8080, 2, 1,'test1', STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW')); +INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES +(2, 1, 9102, 'TCP', '', '127.0.0.1', 3306, 2, 1,'test2', STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW')); +INSERT INTO port_mapping(`id`, `license_id`, `server_port`, `protocal`, `subdomain`, `client_ip`, `client_port`, `is_online`, `enable`,`description`, `create_time`, `update_time`) VALUES +(3, 1, 9103, 'HTTP', 'test2', '127.0.0.1', 8081, 2, 1,'test3', STRFTIME('%s000', 'NOW'), STRFTIME('%s000', 'NOW')); \ No newline at end of file diff --git a/neutrino-proxy-server/src/main/resources/sql/sqlite/update/UPDATE-20230402.SQL b/neutrino-proxy-server/src/main/resources/sql/sqlite/update/UPDATE-20230402.SQL index d7a00fe8..c5e91f3c 100644 --- a/neutrino-proxy-server/src/main/resources/sql/sqlite/update/UPDATE-20230402.SQL +++ b/neutrino-proxy-server/src/main/resources/sql/sqlite/update/UPDATE-20230402.SQL @@ -1,2 +1,3 @@ ALTER TABLE port_mapping ADD `protocal` varchar(10) NOT NULL DEFAULT 'TCP'; -ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL; \ No newline at end of file +ALTER TABLE port_mapping ADD `subdomain` varchar(50) DEFAULT NULL; +ALTER TABLE port_mapping ADD `description` varchar(100);