This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch release-v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v1.0 by this push:
     new 6e14cfa7b fix: fix scope config for postgresql (#8265)
6e14cfa7b is described below

commit 6e14cfa7be1d1f6e5949411e1dce313d437a4659
Author: Kostas Petrakis <[email protected]>
AuthorDate: Mon Jan 20 12:18:02 2025 +0100

    fix: fix scope config for postgresql (#8265)
---
 backend/helpers/srvhelper/scope_config_service_helper.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/helpers/srvhelper/scope_config_service_helper.go 
b/backend/helpers/srvhelper/scope_config_service_helper.go
index 6c7e3e05f..7a93492a6 100644
--- a/backend/helpers/srvhelper/scope_config_service_helper.go
+++ b/backend/helpers/srvhelper/scope_config_service_helper.go
@@ -82,7 +82,7 @@ func (scopeConfigSrv *ScopeConfigSrvHelper[C, S, SC]) 
GetProjectsByScopeConfig(p
                dal.Select(fmt.Sprintf("bp.id AS blueprint_id, bp.project_name, 
bps.scope_id, %s.*", scopeTable)),
                dal.From("_devlake_blueprint_scopes bps"),
                dal.Join("LEFT JOIN _devlake_blueprints bp ON (bp.id = 
bps.blueprint_id)"),
-               dal.Join(fmt.Sprintf("LEFT JOIN %s ON (%s.connection_id = 
bps.connection_id AND %s = bps.scope_id)", scopeTable, scopeTable, theOtherPk)),
+               dal.Join(fmt.Sprintf("LEFT JOIN %s ON (%s.connection_id = 
bps.connection_id AND cast(%s as varchar) = bps.scope_id)", scopeTable, 
scopeTable, theOtherPk)),
                dal.Where("bps.plugin_name = ? AND bps.connection_id = ?", 
pluginName, (*scopeConfig).ScopeConfigConnectionId()),
        ))
        projectScopeMap := make(map[string]*models.ProjectScope)

Reply via email to