feat(sql): 初始化频道、话题及关系数据

- 添加 leaf-segment 分布式ID配置表及初始数据

fix(pom):修正模块 artifactId 命名

- 将 han-note-api 模块名称更正为 han-note-note-api
This commit is contained in:
2025-10-11 23:31:26 +08:00
parent 3ce029ecce
commit eaa5586211
4 changed files with 31 additions and 7 deletions

View File

@@ -15,5 +15,6 @@
</list> </list>
</option> </option>
</inspection_tool> </inspection_tool>
<inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
</profile> </profile>
</component> </component>

View File

@@ -11,7 +11,7 @@
<!-- 打包方式 --> <!-- 打包方式 -->
<packaging>jar</packaging> <packaging>jar</packaging>
<artifactId>han-note-api</artifactId> <artifactId>han-note-note-api</artifactId>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
<description>RPC层, 供其他服务调用</description> <description>RPC层, 供其他服务调用</description>

View File

@@ -16,11 +16,17 @@ VALUES (1, 1, 1, now(), now(), b'0');
INSERT INTO `t_role_permission_rel` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `is_deleted`) INSERT INTO `t_role_permission_rel` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `is_deleted`)
VALUES (2, 1, 2, now(), now(), b'0'); VALUES (2, 1, 2, now(), now(), b'0');
INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('美食', now(), now(), 0); INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`)
INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('娱乐', now(), now(), 0); VALUES ('美食', now(), now(), 0);
INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`)
VALUES ('娱乐', now(), now(), 0);
INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('高分美剧推荐', now(), now(), 0); INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`)
INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('下饭综艺推荐', now(), now(), 0); VALUES ('高分美剧推荐', now(), now(), 0);
INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`)
VALUES ('下饭综艺推荐', now(), now(), 0);
INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) VALUES (2, 1, now(), now()); INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`)
INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) VALUES (2, 2, now(), now()); VALUES (2, 1, now(), now());
INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`)
VALUES (2, 2, now(), now());

17
sql/leafcreatetable.sql Normal file
View File

@@ -0,0 +1,17 @@
INSERT INTO `leaf`.`leaf` (`biz_tag`, `max_id`, `step`, `description`, `update_time`)
VALUES ('leaf-segment-hannote-id', 10100, 2000, '小憨书 ID', now());
INSERT INTO `leaf`.`leaf` (`biz_tag`, `max_id`, `step`, `description`, `update_time`)
VALUES ('leaf-segment-user-id', 100, 2000, '用户 ID', now());
CREATE TABLE `leaf`
(
`biz_tag` varchar(128) NOT NULL DEFAULT '',
`max_id` bigint(20) NOT NULL DEFAULT '1',
`step` int(11) NOT NULL,
`description` varchar(256) DEFAULT NULL,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`biz_tag`)
) ENGINE = InnoDB;