feat: 主键自增改雪花 ID(为分库分表预留)

- 52 个 entity 主键 @TableId 由 IdType.AUTO 改为 IdType.ASSIGN_ID(雪花)
- 双服务 application.yml 的 mybatis-plus id-type 由 auto 改为 assign_id
- schema 脚本主键去掉 GENERATED BY DEFAULT AS IDENTITY
This commit is contained in:
Zhou Weidong committed 2026-10-17 02:26:43 +08:00
1 parent 5f9483a86c
commit bbf46b3445
57 files changed
+115 -115

No files matched your search

@@ -16,7 +16,7 @@ import java.time.LocalDateTime;
@TableName("content_banner")
public class ContentBanner {
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ASSIGN_ID)
private Long id;
private String imageUrl;
/** 展示位置,列名为 slot(position 在 PostgreSQL 里是关键字) */
@@ -16,7 +16,7 @@ import java.time.LocalDateTime;
@TableName("drama")
public class Drama {
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ASSIGN_ID)
private Long id;
private String code;
private String title;
@@ -11,7 +11,7 @@ import lombok.Data;
@TableName("drama_category")
public class DramaCategory {
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ASSIGN_ID)
private Long id;
private String name;
private Integer sort;
@@ -16,7 +16,7 @@ import java.time.LocalDateTime;
@TableName("drama_episode")
public class DramaEpisode {
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ASSIGN_ID)
private Long id;
private Long dramaId;
private Integer epNo;
@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
@TableName("drama_review_record")
public class DramaReviewRecord {
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ASSIGN_ID)
private Long id;
private String bizType;
private Long bizId;