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_service (create_time,update_time,service_name,service_ip,port,description,"version",service_type) VALUES
	 (NULL,NULL,'edge-management','10.60.16.29','9700','边缘管理服务','2.5.1','BUSINESS_SERVICE'),
	 (NULL,NULL,'nacos','10.60.16.29','8848','注册中心','v2.1.1','BUSINESS_SERVICE'),
	 (NULL,NULL,'auth','10.60.16.29','9010','人员权限服务','1.31.2','BUSINESS_SERVICE'),
	 (NULL,NULL,'gateway-license','10.60.16.29','9000','网关服务','2.13.1','BUSINESS_SERVICE'),
	 (NULL,NULL,'data-query-service','10.60.16.29','9812','数据查询服务','2.0.2','BUSINESS_SERVICE'),
	 (NULL,NULL,'data-storage-service','10.60.16.29','9814','数据存储服务','2.0.3','BUSINESS_SERVICE'),
	 (NULL,NULL,'data-process','10.60.16.29','9819','数据引擎服务','2.0.2','BUSINESS_SERVICE'),
	 (NULL,NULL,'hiper-matrix-web','10.60.16.29','9030','web服务','2.1.1','BUSINESS_SERVICE'),
	 (NULL,NULL,'system-service','10.60.16.29','9850','系统服务','2.1.1','BUSINESS_SERVICE'),
	 (NULL,NULL,'iot-alarm','10.60.16.29','9860','报警服务','2.0.1','BUSINESS_SERVICE');
     
INSERT INTO public.hv_em_service (create_time,update_time,service_name,service_ip,port,description,"version",service_type) VALUES
	 (NULL,NULL,'edge-connection','10.60.16.29','9800','边缘采集服务','2.5.1','BUSINESS_SERVICE'),
	 (NULL,NULL,'influxdb','10.60.16.29','8086','时序数据库服务',NULL,'MIDDLEWARE_SERVER'),
	 (NULL,NULL,'rabbitmq','10.60.16.29','5672','消息队列服务',NULL,'MIDDLEWARE_SERVER'),
	 (NULL,NULL,'redis','10.60.16.29','6379','缓存服务',NULL,'MIDDLEWARE_SERVER');

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.29: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.29','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.29','5672','','','admin','Matrix@hVisionS2MQ','','','',0,false,'','','','','','','','','','hiot','topic','','','');
