Skip to content

Commit

Permalink
add sql
Browse files Browse the repository at this point in the history
  • Loading branch information
Terminator111 committed Aug 1, 2024
1 parent 66ce553 commit adbf69d
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions db/init/mysql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,55 @@ CREATE TABLE IF NOT EXISTS `scale_rule`
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

DROP TABLE IF EXISTS `scale_history`;
CREATE TABLE IF NOT EXISTS `scale_history`
(
`id` varchar(128) NOT NULL COMMENT 'primary key id',
`config_id` int(0) NOT NULL COMMENT '0:manual 1:period 2:dynamic',
`num` int NOT NULL COMMENT 'number of bootstrap',
`action` int(0) NOT NULL COMMENT 'status 1:enable 0:disable',
`msg` text COMMENT 'message',
`date_created` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
`date_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT 'update time',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for scale
-- ----------------------------
DROP TABLE IF EXISTS `scale_policy`;
CREATE TABLE IF NOT EXISTS `scale_policy`
(
`id` varchar(128) NOT NULL COMMENT 'primary key id',
`sort` int(0) NOT NULL COMMENT 'sort',
`status` int(0) NOT NULL COMMENT 'status 1:enable 0:disable',
`num` int COMMENT 'number of bootstrap',
`begin_time` datetime(3) COMMENT 'begin time',
`end_time` datetime(3) COMMENT 'end time',
`date_created` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
`date_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT 'update time',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

INSERT INTO `shenyu`.`scale_policy` (`id`, `sort`, `status`, `num`, `begin_time`, `end_time`, `date_created`, `date_updated`) VALUES ('1', 1, 0, 10, NULL, NULL, '2024-07-31 20:00:00.000', '2024-07-31 20:00:00.000');
INSERT INTO `shenyu`.`scale_policy` (`id`, `sort`, `status`, `num`, `begin_time`, `end_time`, `date_created`, `date_updated`) VALUES ('2', 2, 0, 10, '2024-07-31 20:00:00.000', '2024-08-01 20:00:00.000', '2024-07-31 20:00:00.000', '2024-07-31 20:00:00.000');
INSERT INTO `shenyu`.`scale_policy` (`id`, `sort`, `status`, `num`, `begin_time`, `end_time`, `date_created`, `date_updated`) VALUES ('3', 3, 0, NULL, NULL, NULL, '2024-07-31 20:00:00.000', '2024-07-31 20:00:00.000');

DROP TABLE IF EXISTS `scale_rule`;
CREATE TABLE IF NOT EXISTS `scale_rule`
(
`id` varchar(128) NOT NULL COMMENT 'primary key id',
`metric_name` varchar(128) NOT NULL COMMENT 'metric name',
`type` int(0) NOT NULL COMMENT 'type 0:shenyu 1:k8s 2:others',
`sort` int(0) NOT NULL COMMENT 'sort',
`status` int(0) NOT NULL COMMENT 'status 1:enable 0:disable',
`minimum` varchar(128) COMMENT 'minimum of metric',
`maximum` varchar(128) COMMENT 'maximum of metric',
`date_created` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT 'create time',
`date_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT 'update time',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

DROP TABLE IF EXISTS `scale_history`;
CREATE TABLE IF NOT EXISTS `scale_history`
(
Expand Down

0 comments on commit adbf69d

Please sign in to comment.