jcasbin / casbin-spring-boot-starter

Spring Boot 2.x & 3.x Starter for Casbin, see example at: https://github.com/jcasbin/casbin-spring-boot-example

Home Page:https://mvnrepository.com/artifact/org.casbin/casbin-spring-boot-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no ‘id’ in casbin rule?

wy10cheng opened this issue · comments

Coming from this issue: node-casbin/sequelize-adapter#38

Hi,

Currently most of the casbin adapter casbin_rule table had added an ‘id’ column as the primary key. Could you please tell is it capable for this project to add back the ‘id’ column? Thanks a lot.

@wy10cheng can you provide the reproduce example and the crash log?

@shy1st please take a look.

/cc @fangzhengjin

commented

@wy10cheng can you provide the reproduce example and the crash log?

fontend use node-casbin/sequelize-adapter
backend use jcasbin/casbin-spring-boot-starter
because table casbin_rule no id column in casbin-spring-boot-starter, exception throw

"2021-01-22 14:14:20.986 INFO 5143 --- [nio-8080-exec-1] org.casbin.jcasbin : An exception occurred:PreparedStatementCallback; bad SQL grammar [INSERT INTO casbin_rule VALUES(?, ?, ?, ?, ?, ?, ?)]; nested exception is java.sql.SQLException: Column count doesn't match value count at row 1"

@wy10cheng I think it is ok that when we create the table rule, it will generate auto increment primary key.I will make up for that.