Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no ‘id’ in casbin rule? #21

Closed
wy10cheng opened this issue Jan 22, 2021 · 5 comments · Fixed by #24
Closed

no ‘id’ in casbin rule? #21

wy10cheng opened this issue Jan 22, 2021 · 5 comments · Fixed by #24
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@wy10cheng
Copy link

wy10cheng commented Jan 22, 2021

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.

@hsluoyz
Copy link
Member

hsluoyz commented Jan 22, 2021

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

@hsluoyz hsluoyz self-assigned this Jan 22, 2021
@hsluoyz hsluoyz added enhancement New feature or request help wanted Extra attention is needed labels Jan 22, 2021
@hsluoyz
Copy link
Member

hsluoyz commented Jan 22, 2021

@shy1st please take a look.

/cc @fangzhengjin

@Moon-86
Copy link

Moon-86 commented Jan 22, 2021

@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"

@shy1st
Copy link
Contributor

shy1st commented Jan 22, 2021

@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.

@hsluoyz
Copy link
Member

hsluoyz commented Jan 22, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
4 participants