fix: 补充升级缺失的数据库
This commit is contained in:
31
build/database/lite/install/kpi_c_report_ausf.sql
Normal file
31
build/database/lite/install/kpi_c_report_ausf.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS "kpi_c_report_ausf";
|
||||
CREATE TABLE "kpi_c_report_ausf" (
|
||||
"id" integer NOT NULL,
|
||||
"ne_type" text(16),
|
||||
"ne_name" text(64),
|
||||
"rm_uid" text(64),
|
||||
"date" text(10) NOT NULL,
|
||||
"start_time" text(10),
|
||||
"end_time" text(10),
|
||||
"index" integer(11) NOT NULL,
|
||||
"granularity" integer(11),
|
||||
"kpi_values" text,
|
||||
"created_at" integer(20),
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Indexes structure for table kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
CREATE INDEX "idx_c_ausf_uid_at"
|
||||
ON "kpi_c_report_ausf" (
|
||||
"rm_uid" ASC,
|
||||
"created_at" ASC
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
31
build/database/lite/install/kpi_c_report_pcf.sql
Normal file
31
build/database/lite/install/kpi_c_report_pcf.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS "kpi_c_report_pcf";
|
||||
CREATE TABLE "kpi_c_report_pcf" (
|
||||
"id" integer NOT NULL,
|
||||
"ne_type" text(16),
|
||||
"ne_name" text(64),
|
||||
"rm_uid" text(64),
|
||||
"date" text(10) NOT NULL,
|
||||
"start_time" text(10),
|
||||
"end_time" text(10),
|
||||
"index" integer(11) NOT NULL,
|
||||
"granularity" integer(11),
|
||||
"kpi_values" text,
|
||||
"created_at" integer(20),
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Indexes structure for table kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
CREATE INDEX "idx_c_pcf_uid_at"
|
||||
ON "kpi_c_report_pcf" (
|
||||
"rm_uid" ASC,
|
||||
"created_at" ASC
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
30
build/database/lite/upgrade/upg_kpi_c_report_ausf.sql
Normal file
30
build/database/lite/upgrade/upg_kpi_c_report_ausf.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
CREATE TABLE IF NOT EXISTS "kpi_c_report_ausf" (
|
||||
"id" integer NOT NULL,
|
||||
"ne_type" text(16),
|
||||
"ne_name" text(64),
|
||||
"rm_uid" text(64),
|
||||
"date" text(10) NOT NULL,
|
||||
"start_time" text(10),
|
||||
"end_time" text(10),
|
||||
"index" integer(11) NOT NULL,
|
||||
"granularity" integer(11),
|
||||
"kpi_values" text,
|
||||
"created_at" integer(20),
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Indexes structure for table kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
CREATE INDEX IF NOT EXISTS "idx_c_ausf_uid_at"
|
||||
ON "kpi_c_report_ausf" (
|
||||
"rm_uid" ASC,
|
||||
"created_at" ASC
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
30
build/database/lite/upgrade/upg_kpi_c_report_pcf.sql
Normal file
30
build/database/lite/upgrade/upg_kpi_c_report_pcf.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
CREATE TABLE IF NOT EXISTS "kpi_c_report_pcf" (
|
||||
"id" integer NOT NULL,
|
||||
"ne_type" text(16),
|
||||
"ne_name" text(64),
|
||||
"rm_uid" text(64),
|
||||
"date" text(10) NOT NULL,
|
||||
"start_time" text(10),
|
||||
"end_time" text(10),
|
||||
"index" integer(11) NOT NULL,
|
||||
"granularity" integer(11),
|
||||
"kpi_values" text,
|
||||
"created_at" integer(20),
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Indexes structure for table kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
CREATE INDEX IF NOT EXISTS "idx_c_pcf_uid_at"
|
||||
ON "kpi_c_report_pcf" (
|
||||
"rm_uid" ASC,
|
||||
"created_at" ASC
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
37
build/database/lite/upgrade/upg_ne_license.sql
Normal file
37
build/database/lite/upgrade/upg_ne_license.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for ne_license
|
||||
-- ----------------------------
|
||||
CREATE TABLE IF NOT EXISTS "ne_license" (
|
||||
"id" integer NOT NULL,
|
||||
"ne_type" text(32) NOT NULL,
|
||||
"ne_id" text(32) NOT NULL,
|
||||
"activation_request_code" text(255) NOT NULL,
|
||||
"license_path" text(255),
|
||||
"capability" integer,
|
||||
"serial_num" text(32),
|
||||
"expiry_date" text(32),
|
||||
"status" text(32),
|
||||
"remark" text(255),
|
||||
"create_by" text(50),
|
||||
"create_time" integer,
|
||||
"update_by" text(50),
|
||||
"update_time" integer,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Indexes structure for table ne_license
|
||||
-- ----------------------------
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS "uk_lic_type_id"
|
||||
ON "ne_license" (
|
||||
"ne_type" ASC,
|
||||
"ne_id" ASC
|
||||
);
|
||||
|
||||
-- ADD COLUMN
|
||||
ALTER TABLE ne_license ADD COLUMN capability integer;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of ne_license
|
||||
-- ----------------------------
|
||||
INSERT OR IGNORE INTO "ne_license" VALUES (1, 'OMC', '001', '', '', 0, '', '', '0', '', 'system', 1713928436971, '', 0);
|
||||
24
build/database/std/install/kpi_c_report_ausf.sql
Normal file
24
build/database/std/install/kpi_c_report_ausf.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kpi_c_report_ausf`;
|
||||
CREATE TABLE `kpi_c_report_ausf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`ne_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`rm_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_c_ausf_uid_at` (`rm_uid`,`created_at`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_AUSF';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
24
build/database/std/install/kpi_c_report_pcf.sql
Normal file
24
build/database/std/install/kpi_c_report_pcf.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `kpi_c_report_pcf`;
|
||||
CREATE TABLE `kpi_c_report_pcf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`ne_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`rm_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_c_pcf_uid_at` (`rm_uid`,`created_at`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_PCF';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
23
build/database/std/upgrade/upg_kpi_c_report_ausf.sql
Normal file
23
build/database/std/upgrade/upg_kpi_c_report_ausf.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_ausf
|
||||
-- ----------------------------
|
||||
CREATE TABLE IF NOT EXISTS `kpi_c_report_ausf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`ne_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`rm_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_c_ausf_uid_at` (`rm_uid`,`created_at`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_AUSF';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
23
build/database/std/upgrade/upg_kpi_c_report_pcf.sql
Normal file
23
build/database/std/upgrade/upg_kpi_c_report_pcf.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for kpi_c_report_pcf
|
||||
-- ----------------------------
|
||||
CREATE TABLE IF NOT EXISTS `kpi_c_report_pcf` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`ne_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`rm_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
|
||||
`date` varchar(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'Date of the report yyyy-mm-dd hh:mi:ss',
|
||||
`start_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'Start time of the report hh:mi:ss',
|
||||
`end_time` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'End time of the report hh:mi:ss',
|
||||
`index` int NOT NULL COMMENT 'Index of the report',
|
||||
`granularity` int DEFAULT '60' COMMENT 'Time granualarity: 5/10/.../60/300 (second)',
|
||||
`kpi_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT 'KPI values JSON String',
|
||||
`created_at` bigint DEFAULT '0' COMMENT 'Creation time 接收到的timestamp秒级存储毫秒时间戳',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_c_pcf_uid_at` (`rm_uid`,`created_at`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='KPI_自定义指标数据_PCF';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
34
build/database/std/upgrade/upg_ne_license.sql
Normal file
34
build/database/std/upgrade/upg_ne_license.sql
Normal file
@@ -0,0 +1,34 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
--
|
||||
-- Table structure for table `ne_license`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `ne_license` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||
`ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网元类型',
|
||||
`ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '网元ID',
|
||||
`activation_request_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '激活申请代码',
|
||||
`license_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '激活授权文件',
|
||||
`capability` bigint DEFAULT '0' COMMENT '用户容量',
|
||||
`serial_num` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '序列号',
|
||||
`expiry_date` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '许可证到期日期',
|
||||
`status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '状态 0无效 1有效',
|
||||
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
|
||||
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` bigint DEFAULT '0' COMMENT '创建时间',
|
||||
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` bigint DEFAULT '0' COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_lic_type_id` (`ne_type`,`ne_id`) USING BTREE COMMENT '唯一网元类型和网元ID'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_授权激活信息';
|
||||
|
||||
-- ADD COLUMN
|
||||
ALTER TABLE `ne_license` ADD COLUMN `capability` bigint DEFAULT '0' COMMENT '容量';
|
||||
|
||||
-- 初始数据对应网元
|
||||
INSERT IGNORE INTO `ne_license` VALUES (1, 'OMC', '001', '', '', 0, '', '', '0', '', 'system', 1713928436971, '', 0);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
|
||||
-- Dump completed on 2025-02-14 15:26:56
|
||||
@@ -7,7 +7,7 @@ type NeLicense struct {
|
||||
NeId string `json:"neId" gorm:"column:ne_id" binding:"required"` // 网元ID
|
||||
ActivationRequestCode string `json:"activationRequestCode" gorm:"column:activation_request_code"` // 激活申请代码
|
||||
LicensePath string `json:"licensePath" gorm:"column:license_path"` // 激活授权文件
|
||||
Capability int64 `json:"capability" gorm:"column:capability"` // 用户容量
|
||||
Capability int64 `json:"capability" gorm:"column:capability"` // 容量
|
||||
SerialNum string `json:"serialNum" gorm:"column:serial_num"` // 序列号
|
||||
ExpiryDate string `json:"expiryDate" gorm:"column:expiry_date"` // 许可证到期日期
|
||||
Status string `json:"status" gorm:"column:status"` // 状态 0无效 1有效
|
||||
|
||||
Reference in New Issue
Block a user