adamsaghy commented on code in PR #5452:
URL: https://github.com/apache/fineract/pull/5452#discussion_r2792625835
##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/core/service/database/PostgreSQLQueryService.java:
##########
@@ -44,8 +44,10 @@ public boolean isSupported() {
@Override
public boolean isTablePresent(DataSource dataSource, String tableName) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
+ // Use current_schema for consistency with getTableColumns() and
getTableIndexes().
+ // This ensures tenant-specific schemas work correctly (FINERACT-2468).
Review Comment:
We dont need this comments!
##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/core/service/database/PostgreSQLQueryService.java:
##########
@@ -67,7 +69,10 @@ public SqlRowSet getTableColumns(DataSource dataSource,
String tableName) {
@Override
public List<IndexDetail> getTableIndexes(DataSource dataSource, String
tableName) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- String sql = "SELECT indexname FROM pg_indexes WHERE schemaname =
'public' AND tablename = ?";
+ // Use current_schema instead of hardcoded 'public' to support
tenant-specific schemas.
+ // This fixes datatable operations in multi-tenant PostgreSQL
deployments where
+ // datatables reside in non-public schemas (FINERACT-2468).
+ String sql = "SELECT indexname FROM pg_indexes WHERE schemaname =
current_schema() AND tablename = ?";
Review Comment:
We dont need this comments!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]