Closed tsoultanopoulos closed 1 year ago
@nodece @Zxilly @Shivansh-yadav13 please review
@nodece plz review
@tsoultanopoulos fix:
Totals | |
---|---|
Change from base Build 4439363605: | 0.09% |
Covered Lines: | 117 |
Relevant Lines: | 126 |
:tada: This PR is included in version 2.7.0 :tada:
The release is available on:
npm package (@latest dist-tag)
Your semantic-release bot :package::rocket:
Fix: https://github.com/node-casbin/sequelize-adapter/issues/78
Why? Previously, the system utilized multiple adapters to establish connections with different databases based on their respective schemas. However, there was an unintended behavior where the last adapter defined in the configuration would override the previous ones, resulting in only a single database connection being used, regardless of the schema.it supposed that was solved with this PR but the issue still persists. What was changed? In the updated code, a new CasbinRule model is dynamically created for each Sequelize adapter instance with the createCasbinRule function. This function generates a custom CasbinRule model class with its own tableName and schema options. This ensures that different Sequelize adapters have isolated configurations, avoiding potential clashes when multiple adapters are opened with different table names or schemas.