From 908d5f55edebbe511f3ab9b9636123d3edd1ad52 Mon Sep 17 00:00:00 2001 From: chenxi Date: Thu, 18 Jul 2024 17:27:34 +0800 Subject: [PATCH 1/2] feat: remove the underscore from the getFullTableName method --- adapter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapter.go b/adapter.go index 0cea971..6ef7f26 100755 --- a/adapter.go +++ b/adapter.go @@ -391,7 +391,7 @@ func (a *Adapter) getTableInstance() *CasbinRule { func (a *Adapter) getFullTableName() string { if a.tablePrefix != "" { - return a.tablePrefix + "_" + a.tableName + return a.tablePrefix + a.tableName } return a.tableName } From 2af56fa85ea9cdb7b40b7e83fe0cecbb00f3f03d Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 19 Jul 2024 10:06:17 +0800 Subject: [PATCH 2/2] fix: Remove underscores from the getFullTableName method when they are present --- adapter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adapter.go b/adapter.go index 6ef7f26..49dc9a5 100755 --- a/adapter.go +++ b/adapter.go @@ -391,7 +391,10 @@ func (a *Adapter) getTableInstance() *CasbinRule { func (a *Adapter) getFullTableName() string { if a.tablePrefix != "" { - return a.tablePrefix + a.tableName + if strings.HasSuffix(a.tablePrefix, "_") { + return a.tablePrefix + a.tableName + } + return a.tablePrefix + "_" + a.tableName } return a.tableName }