From 4624b6fd58f262ab95f2d60472560b9fc162d677 Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期二, 01 四月 2025 14:56:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql b/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql index b000a0f..31bcd5a 100644 --- a/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql +++ b/iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql @@ -238,7 +238,8 @@ `tag_desc` varchar(64) DEFAULT NULL COMMENT '描述', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - PRIMARY KEY (`id`) USING BTREE + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `uk_api_tag` (`api_id`, `tag_name`) USING BTREE ) ENGINE=InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT='接口Tag表'; -- 指标管理------------ @@ -322,6 +323,8 @@ PRIMARY KEY (id) USING BTREE, UNIQUE KEY `uk_item_id` (`item_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '派生指标'; + +ALTER TABLE t_ind_item_der ADD COLUMN month_start int COMMENT '月周期开始日'; CREATE TABLE t_ind_item_cal( `id` VARCHAR(36) NOT NULL COMMENT 'ID' , @@ -408,4 +411,35 @@ `collect_time` DATETIME COMMENT '采集时间' , PRIMARY KEY (id) USING BTREE, UNIQUE KEY `uk_point_no` (`point_no`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '测点采集状态表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '测点采集状态表'; + +ALTER TABLE `t_ind_item` ADD COLUMN `solidify_flag` varchar(36) NULL COMMENT '固化标识' AFTER `status`, +MODIFY COLUMN `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' AFTER `create_time`; + +ALTER TABLE `t_ind_item_value` + MODIFY COLUMN `data_time` datetime NULL DEFAULT NULL COMMENT '数据时间' AFTER `item_no`; + +CREATE TABLE `t_arc_data` ( + `id` varchar(36) NOT NULL COMMENT 'id', + `arc_id` varchar(36) DEFAULT NULL COMMENT '归档id', + `code` varchar(30) DEFAULT NULL COMMENT '编码', + `arc_time` varchar(30) DEFAULT NULL COMMENT '归档时间', + `arc_value` DECIMAL(18,6) DEFAULT NULL COMMENT '归档值', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='归档数据表'; + +CREATE TABLE `t_arc_setting` ( + `id` varchar(36) NOT NULL COMMENT 'id', + `code` varchar(30) DEFAULT NULL COMMENT '编码', + `name` varchar(30) DEFAULT NULL COMMENT '名称', + `type` varchar(10) DEFAULT NULL COMMENT '归档周期(shift、day、month、year)', + `point` varchar(36) DEFAULT NULL COMMENT '归档点位', + `calculate` varchar(10) DEFAULT NULL COMMENT '计算方法(none、sum、diff、avg)', + `sort` int COMMENT '排序', + `is_enable` tinyint(1) DEFAULT 1 COMMENT '是否启用', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_code` (`code`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='定时归档设置表'; \ No newline at end of file -- Gitblit v1.9.3