Skip to content

Commit

Permalink
chore: add agg sql (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
xzchaoo authored Oct 13, 2023
1 parent 6755b2d commit ef4c873
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
CREATE TABLE IF NOT EXISTS `agg_offset_v1` (
`id` bigint NOT NULL AUTO_INCREMENT,
`gmt_create` datetime NOT NULL,
`gmt_modified` datetime NOT NULL,
`partition` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`consumer_group` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`version` bigint NOT NULL,
`data` blob,
PRIMARY KEY (`id`),
KEY `k_partition_version` (`partition`,`consumer_group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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;

CREATE TABLE IF NOT EXISTS `agg_state_v1` (
`id` bigint NOT NULL AUTO_INCREMENT,
`gmt_create` datetime NOT NULL,
`gmt_modified` datetime NOT NULL,
`partition` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`consumer_group` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`state` longblob,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_partition` (`partition`, `consumer_group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

0 comments on commit ef4c873

Please sign in to comment.