Skip to content

Commit

Permalink
fix: db2 adapter issue (#50)
Browse files Browse the repository at this point in the history
* fix db2 adaptor issue

issue: #47


Signed-off-by: Macky <liuyunsh@cn.ibm.com>

* fix sql issue and sonar issue for db2adptor

fix #47

Signed-off-by: Macky <liuyunsh@cn.ibm.com>

* update node version from 12 to 16

issue: https://github.com/jcasbin/casbin-spring-boot-starter/runs/4318955733?check_suite_focus=true

Signed-off-by: Macky <liuyunsh@cn.ibm.com>

Co-authored-by: Macky <liuyunsh@cn.ibm.com>
  • Loading branch information
doctormacky and liuyunsh authored Nov 25, 2021
1 parent 5220c75 commit 14b7f6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
- name: semantic-release
run: |
npm install -g semantic-release @semantic-release/exec
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/casbin/adapter/DB2Adapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ public class DB2Adapter extends JdbcAdapter {

private static final String CHECK_TABLE_SQL = "select 1 from syscat.tables where tabname = upper('CASBIN_RULE')";

private final static String DROP_TABLE_SQL = "DROP TABLE CASBIN_RULE";
private static final String DROP_TABLE_SQL = "DROP TABLE CASBIN_RULE";

private static final String INIT_TABLE_SQL = "CREATE TABLE CASBIN_RULE (" +
" ID int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, "+
" ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1) ,"+
" PTYPE VARCHAR(255) NOT NULL ," +
" V0 VARCHAR(255) DEFAULT NULL ," +
" V1 VARCHAR(255) DEFAULT NULL ," +
" V2 VARCHAR(255) DEFAULT NULL ," +
" V3 VARCHAR(255) DEFAULT NULL ," +
" V4 VARCHAR(255) DEFAULT NULL ," +
" V5 VARCHAR(255) DEFAULT NULL" +
" V5 VARCHAR(255) DEFAULT NULL ," +
" PRIMARY KEY (ID) " +
")";

/**
Expand Down

0 comments on commit 14b7f6b

Please sign in to comment.