From 96918ae022403fcb4f058c4d5a81e42bfe1488e5 Mon Sep 17 00:00:00 2001 From: Yixiang Zhao Date: Thu, 10 Feb 2022 21:24:54 +0800 Subject: [PATCH] fix: org.h2.jdbc.JdbcSQLSyntaxErrorException after H2 version upgrade (#62) Signed-off-by: Yixiang Zhao --- build.gradle | 2 +- src/main/java/org/casbin/adapter/JdbcAdapter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 579295c..da357c0 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ configurations { dependencies { compile 'org.casbin:jcasbin:1.21.0' - compile 'com.h2database:h2' + compile 'com.h2database:h2:2.1.210' implementation 'org.springframework.boot:spring-boot-starter-jdbc' compileOnly 'org.springframework.boot:spring-boot-starter-data-redis' diff --git a/src/main/java/org/casbin/adapter/JdbcAdapter.java b/src/main/java/org/casbin/adapter/JdbcAdapter.java index 13d46fe..763c349 100644 --- a/src/main/java/org/casbin/adapter/JdbcAdapter.java +++ b/src/main/java/org/casbin/adapter/JdbcAdapter.java @@ -36,7 +36,7 @@ public class JdbcAdapter implements FilteredAdapter { private String tableName; private static final String INIT_TABLE_SQL = "CREATE TABLE IF NOT EXISTS casbin_rule (" + - " id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, "+ + " id int NOT NULL AUTO_INCREMENT PRIMARY KEY, "+ " ptype varchar(255) NOT NULL," + " v0 varchar(255) DEFAULT NULL," + " v1 varchar(255) DEFAULT NULL," +