This is an automated email from the ASF dual-hosted git repository.

nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git


The following commit(s) were added to refs/heads/main by this push:
     new 4f95b780 [Bugfix] Fix the problem of negative primary key (#309)
4f95b780 is described below

commit 4f95b78081fc41c089629088b5c4c07fc31972e2
Author: s7monk <[email protected]>
AuthorDate: Wed Jun 5 13:20:13 2024 +0800

    [Bugfix] Fix the problem of negative primary key (#309)
---
 .../main/java/org/apache/paimon/web/server/data/model/BaseModel.java | 2 +-
 scripts/sql/paimon-mysql.sql                                         | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/BaseModel.java
 
b/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/BaseModel.java
index 2d5f6f5c..eeef80b8 100644
--- 
a/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/BaseModel.java
+++ 
b/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/BaseModel.java
@@ -35,7 +35,7 @@ import java.util.Map;
 public abstract class BaseModel implements Serializable {
 
     /** id. */
-    @TableId(type = IdType.ASSIGN_ID)
+    @TableId(type = IdType.AUTO)
     private Integer id;
 
     /** create time. */
diff --git a/scripts/sql/paimon-mysql.sql b/scripts/sql/paimon-mysql.sql
index e348358e..6f2f53f0 100644
--- a/scripts/sql/paimon-mysql.sql
+++ b/scripts/sql/paimon-mysql.sql
@@ -113,8 +113,7 @@ CREATE TABLE if not exists `role_menu`
 DROP TABLE IF EXISTS `catalog`;
 CREATE TABLE if not exists `catalog`
 (
-    id            int                                  not null comment 'id'
-    primary key,
+    id            int(11)  not null auto_increment primary key comment 'id',
     catalog_type  varchar(50)                          not null comment 
'catalog type',
     catalog_name  varchar(100)                         not null comment 
'catalog name',
     warehouse     varchar(200)                         not null comment 
'warehouse',
@@ -142,7 +141,7 @@ CREATE TABLE if not exists `cluster`
 DROP TABLE IF EXISTS `cdc_job_definition`;
 CREATE TABLE if not exists `cdc_job_definition`
 (
-    id          int                                not null comment 'id',
+    id          int(11)  not null auto_increment primary key comment 'id',
     `name`      varchar(20)                        not null comment 'name',
     description varchar(200)                       null comment 'description',
     cdc_type    int                                not null comment 'cdc type 
',

Reply via email to