jcasbin / jdbc-adapter

JDBC adapter for Casbin
https://github.com/casbin/jcasbin
Apache License 2.0
34 stars 38 forks source link

fix: if MySQL, check the existence of the table. #39

Closed Javakky-pxv closed 2 years ago

Javakky-pxv commented 2 years ago

I'm using this tool in my product. However, the CREATE statement cannot be executed due to the restricted user rights of the DB. Therefore, if I'm using MySQL, this tool needs to check the existence of the table first.

In this PR, if productName is "MySQL", the SHOW TABLE statement will check for the existence of the table. If the table exists, no further migration will be performed.

casbin-bot commented 2 years ago

@tangyang9464 @seriouszyx @elfisworking @fangzhengjin please review

hsluoyz commented 2 years ago

@seriouszyx please review

seriouszyx commented 2 years ago

@Javakky-pxv Please modify the commit message with conventions such as Angular.

hsluoyz commented 2 years ago

@Javakky-pxv plz fix:

image

Javakky-pxv commented 2 years ago

Sorry. I am not sure about the use properly of "fix" and "refactor". I don't think this PR is about fixing a bug, but can I use the prefix "fix"?

codecov[bot] commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@b7e2d4c). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #39   +/-   ##
=========================================
  Coverage          ?   72.11%           
=========================================
  Files             ?        3           
  Lines             ?      269           
  Branches          ?       72           
=========================================
  Hits              ?      194           
  Misses            ?       39           
  Partials          ?       36           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b7e2d4c...868ccc7. Read the comment docs.