diff --git a/EdgeManager/Init.php b/EdgeManager/Init.php index aed5ec8..f77e4c3 100644 --- a/EdgeManager/Init.php +++ b/EdgeManager/Init.php @@ -10,11 +10,17 @@ function init_db($server_name, $port, $user, $password) { $dbconn = pg_connect(sprintf("host=%s port=%s dbname=scada user=%s password=%s", $server_name, $port, $user, $password)); // 全局未启用TSDB的时候在这里对scada数据库启用就好 pg_query($dbconn, "CREATE EXTENSION IF NOT EXISTS timescaledb"); + pg_query( + $dbconn, + "CREATE TYPE category + AS ENUM ('DEVICE_STATUS', 'ITEM_ID', 'DEVICE_DATA', 'PROCESS_DATA', 'RESULT_DATA', 'STATISTICAL_DATA')" + ); pg_query($dbconn, "CREATE TABLE IF NOT EXISTS hf_mes_scada_data_capture_node_configure ( id serial2 primary key, code text, name text NOT NULL, type text NOT NULL, + category category, flow_code text, working_subclass text NOT NULL, workstation text,