Skip to content

Commit

Permalink
fix: fix sql
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangfeng.xzc committed Oct 16, 2023
1 parent f8a88f2 commit eccb088
Showing 1 changed file with 30 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
CREATE TABLE IF NOT EXISTS `agg_offset_v1` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键',
`gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间',
`gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '修改时间',
`partition_name` varchar(255) NOT NULL comment '分区',
`consumer_group` varchar(255) NOT NULL comment '消费者组',
`version` bigint(20) NOT NULL comment '版本号',
`data` blob DEFAULT NULL comment '位点信息',
PRIMARY KEY(`id`),
KEY `k_partition_name_consumer_group`(`partition_name`, `consumer_group`) LOCAL
) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = '消费位点表v1';
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键',
`gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间',
`gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '修改时间',
`partition_name` varchar(255) NOT NULL comment '分区',
`consumer_group` varchar(255) NOT NULL comment '消费者组',
`version` bigint(20) NOT NULL comment '版本号',
`data` blob DEFAULT NULL comment '位点信息',
PRIMARY KEY(`id`),
KEY `k_partition_name_consumer_group`(`partition_name`, `consumer_group`)
) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = '消费位点表v1';

CREATE TABLE IF NOT EXISTS `agg_task_v1` (
`id` bigint NOT NULL AUTO_INCREMENT,
`gmt_create` datetime NOT NULL,
`gmt_modified` datetime NOT NULL,
`agg_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`version` bigint NOT NULL,
`json` text COLLATE utf8mb4_unicode_ci NOT NULL,
`deleted` int NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_agg_id_version` (`agg_id`,`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
`id` bigint(20) NULL AUTO_INCREMENT comment 'pk',
`gmt_create` timestamp NOT NULL comment 'create time',
`gmt_modified` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP comment 'modify time',
`agg_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL comment 'agg id',
`version` bigint(20) NOT NULL comment 'agg version',
`json` text COLLATE utf8mb4_unicode_ci NOT NULL comment 'agg content',
`deleted` int(11) NOT NULL comment 'deletion mark',
PRIMARY KEY(`id`),
UNIQUE KEY `k_agg_id_version`(`agg_id`, `version`)
) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'agg task table';

CREATE TABLE `agg_state_v1` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键',
`gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间',
`gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '修改时间',
`partition_name` varchar(1) NOT NULL comment '分区',
`consumer_group` varchar(1) NOT NULL comment '消费者组',
`state` longblob NOT NULL comment '状态',
PRIMARY KEY(`id`)
) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = '聚合状态存储表v1';
CREATE TABLE IF NOT EXISTS `agg_state_v1` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键',
`gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间',
`gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '修改时间',
`partition_name` varchar(255) NOT NULL comment '分区',
`consumer_group` varchar(255) NOT NULL comment '消费者组',
`state` longblob NOT NULL comment '状态',
PRIMARY KEY(`id`),
UNIQUE KEY `k_partition_name_consumer_group`(`partition_name`, `consumer_group`)
) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = '聚合状态存储表v1';

0 comments on commit eccb088

Please sign in to comment.