SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for kpi_report
-- ----------------------------
CREATE TABLE IF NOT EXISTS `kpi_report`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ne_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `rm_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `date` date NOT NULL,
  `start_time` time NULL DEFAULT NULL,
  `end_time` time NULL DEFAULT NULL,
  `index` smallint(6) NOT NULL,
  `granularity` tinyint(4) NULL DEFAULT 60 COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
  `kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  `created_at` bigint(20) NULL DEFAULT NULL,
  `tenant_id` varchar(32) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `idx_timestamp`(`created_at`) USING BTREE,
  INDEX `idx_uid_datetime`(`rm_uid`, `date`, `start_time`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
