CREATE TABLE public.hv_em_service (
	id bigserial NOT NULL,
	create_time timestamptz NULL,
	update_time timestamptz NULL,
	service_name text NULL,
	service_ip text NULL,
	port text NULL,
	description text NULL,
	"version" text NULL,
	service_type varchar(40) NULL,
	CONSTRAINT hv_em_service_pkey PRIMARY KEY (id)
)
WITH (
	orientation=row,
	compression=no
);
CREATE TABLE public.hv_em_server (
	id bigserial NOT NULL,
	create_time timestamptz NULL,
	update_time timestamptz NULL,
	server_name text NULL,
	server_ip text NULL,
	description text NULL,
	CONSTRAINT hv_em_server_pkey PRIMARY KEY (id)
)
WITH (
	orientation=row,
	compression=no
);
CREATE TABLE public.hv_em_ds_management (
	id bigserial NOT NULL,
	create_time timestamptz NULL,
	update_time timestamptz NULL,
	db_type varchar(50) NULL,
	connect_name varchar(50) NULL,
	description varchar(255) NULL,
	address varchar(255) NULL,
	port varchar(255) NULL,
	db_name varchar(255) NULL,
	table_name varchar(255) NULL,
	user_name varchar(255) NULL,
	"password" varchar(255) NULL,
	sid varchar(255) NULL,
	service_name varchar(255) NULL,
	monitor_frequency varchar(255) NULL,
	"storage" numeric NULL,
	enable_ssl bool NULL,
	trust_certificate_key_store_url varchar(255) NULL,
	trust_certificate_key_store_content text NULL,
	ca_key_store varchar(255) NULL,
	ca_key_store_content text NULL,
	ca_key_store_pass_word varchar(255) NULL,
	trust_certificate_key_store_password varchar(255) NULL,
	client_certificate_key_store_url varchar(255) NULL,
	client_certificate_key_store_content text NULL,
	client_certificate_key_store_password varchar(255) NULL,
	exchange_name varchar(255) NULL,
	exchange_type varchar(255) NULL,
	topic varchar(255) NULL,
	mqtt_version varchar(255) NULL,
	client_id varchar(255) NULL,
	CONSTRAINT hv_em_ds_management_pkey PRIMARY KEY (id),
	CONSTRAINT idx_hv_em_ds_management_connect_name UNIQUE (connect_name)
)
WITH (
	orientation=row,
	compression=no
);
CREATE UNIQUE INDEX "名称已存在" ON hv_em_ds_management USING btree (connect_name) TABLESPACE pg_default;

INSERT INTO public.hv_em_server (create_time,update_time,server_name,server_ip,description) VALUES (NULL,NULL,'边缘节点服务器','10.60.16.29',NULL);
INSERT INTO public.hv_em_server (id, create_time, update_time, description, server_ip, server_name) VALUES (7, null, null, null, '10.60.16.30', '边缘节点服务器-2');
INSERT INTO public.hv_em_server (id, create_time, update_time, description, server_ip, server_name) VALUES (9, null, null, null, '10.60.16.31', '边缘节点服务器-3');


INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (23, null, null, '时序数据库服务', '10.60.16.29', 'influxdb', '8086', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (25, null, null, '消息队列服务', '10.60.16.29', 'rabbitmq', '5672', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (27, null, null, '缓存服务', '10.60.16.29', 'redis-1', '6379', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (29, null, null, '分布式协调服务', '10.60.16.29', 'zookeeper-1', '2181', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (31, null, null, '边缘管理服务', '10.60.16.29', 'edge-management', '9700', 'BUSINESS_SERVICE', '2.5.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (33, null, null, '注册中心', '10.60.16.29', 'nacos', '8848', 'BUSINESS_SERVICE', 'v2.1.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (35, null, null, '人员权限服务', '10.60.16.29', 'auth', '9010', 'BUSINESS_SERVICE', '1.31.2');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (37, null, null, '网关服务', '10.60.16.29', 'gateway-license', '9000', 'BUSINESS_SERVICE', '2.13.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (39, null, null, '数据查询服务', '10.60.16.29', 'data-query-service', '9812', 'BUSINESS_SERVICE', '2.0.2');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (41, null, null, '数据存储服务', '10.60.16.29', 'data-storage-service', '9814', 'BUSINESS_SERVICE', '2.0.3');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (43, null, null, '数据引擎服务', '10.60.16.29', 'data-process', '9819', 'BUSINESS_SERVICE', '2.0.2');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (45, null, null, 'web服务', '10.60.16.29', 'hiper-matrix-web', '9030', 'BUSINESS_SERVICE', '2.1.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (47, null, null, '系统服务', '10.60.16.29', 'system-service', '9850', 'BUSINESS_SERVICE', '2.1.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (49, null, null, '报警服务', '10.60.16.29', 'iot-alarm', '9860', 'BUSINESS_SERVICE', '2.0.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (51, null, null, '边缘采集服务', '10.60.16.29', 'edge-connection', '9800', 'BUSINESS_SERVICE', '2.5.1');

INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (55, null, null, '时序数据库服务', '10.60.16.30', 'influxdb', '8086', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (57, null, null, '消息队列服务', '10.60.16.30', 'rabbitmq', '5672', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (59, null, null, '缓存服务', '10.60.16.30', 'redis-2', '6379', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (61, null, null, '分布式协调服务', '10.60.16.30', 'zookeeper-2', '2181', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (63, null, null, '边缘管理服务', '10.60.16.30', 'edge-management', '9700', 'BUSINESS_SERVICE', '2.5.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (65, null, null, '注册中心', '10.60.16.30', 'nacos', '8848', 'BUSINESS_SERVICE', 'v2.1.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (67, null, null, '人员权限服务', '10.60.16.30', 'auth', '9010', 'BUSINESS_SERVICE', '1.31.2');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (69, null, null, '网关服务', '10.60.16.30', 'gateway-license', '9000', 'BUSINESS_SERVICE', '2.13.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (71, null, null, '数据查询服务', '10.60.16.30', 'data-query-service', '9812', 'BUSINESS_SERVICE', '2.0.2');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (73, null, null, '数据存储服务', '10.60.16.30', 'data-storage-service', '9814', 'BUSINESS_SERVICE', '2.0.3');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (75, null, null, '数据引擎服务', '10.60.16.30', 'data-process', '9819', 'BUSINESS_SERVICE', '2.0.2');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (77, null, null, 'web服务', '10.60.16.30', 'hiper-matrix-web', '9030', 'BUSINESS_SERVICE', '2.1.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (79, null, null, '系统服务', '10.60.16.30', 'system-service', '9850', 'BUSINESS_SERVICE', '2.1.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (81, null, null, '报警服务', '10.60.16.30', 'iot-alarm', '9860', 'BUSINESS_SERVICE', '2.0.1');
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (83, null, null, '边缘采集服务', '10.60.16.30', 'edge-connection', '9800', 'BUSINESS_SERVICE', '2.5.1');

INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (85, null, null, '消息队列服务', '10.60.16.31', 'rabbitmq', '5672', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (87, null, null, '缓存服务', '10.60.16.31', 'redis-3', '6379', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (89, null, null, '分布式协调服务', '10.60.16.31', 'zookeeper-3', '2181', 'MIDDLEWARE_SERVER', null);
INSERT INTO public.hv_em_service (id, create_time, update_time, description, service_ip, service_name, port, service_type, version) VALUES (91, null, null, '注册中心', '10.60.16.31', 'nacos', '8848', 'BUSINESS_SERVICE', 'v2.1.1');


INSERT INTO public.hv_em_ds_management (create_time,update_time,db_type,connect_name,description,address,port,db_name,table_name,user_name,"password",sid,service_name,monitor_frequency,"storage",enable_ssl,trust_certificate_key_store_url,trust_certificate_key_store_content,ca_key_store,ca_key_store_content,ca_key_store_pass_word,trust_certificate_key_store_password,client_certificate_key_store_url,client_certificate_key_store_content,client_certificate_key_store_password,exchange_name,exchange_type,topic,mqtt_version,client_id) VALUES
	 ('2025-03-12 14:34:49.022329+08','2025-03-14 09:34:17.353097+08','MQTT','默认MQTT Server','Matrix平台内置MQTT Server','tcp://10.60.16.200:1883','','','','admin','Matrix@hVisionS2MQ','','','',0,false,'','','','','','','','','','','','','','hvisions-mqtt-client'),
	 ('2025-03-12 14:34:49.052187+08','2025-03-14 09:37:45.481531+08','INFLUXDB','默认InfluxDB Server','Matrix平台内置InfluxDB Server','10.60.16.200','8086','hiot','','admin','Matrix@hVisionS2TSDB','','','',0,false,'','','','','','','','','','','','','',''),
	 ('2025-03-12 14:34:49.083365+08','2025-03-14 09:37:53.887397+08','RabbitMQ','默认RabbitMQ Server','Matrix平台内置RabbitMQ Server','10.60.16.200','5672','','','admin','Matrix@hVisionS2MQ','','','',0,false,'','','','','','','','','','hiot','topic','','','');
