From d4108f60f25d2487b6453a7374815237146dda2a Mon Sep 17 00:00:00 2001
From: Ashhar Ahmad Khan <145142826+AshharAhmadKhan@users.noreply.github.com>
Date: Mon, 16 Feb 2026 23:15:13 +0530
Subject: [PATCH] FINERACT-2481: Remove Pentaho reports from initial sample
data
Remove deprecated Pentaho report entries from initial data using Liquibase migration.
Changes:
- Added migration 0210_remove_pentaho_reports.xml with explicit report names
- Deletes 26 Pentaho permission entries from m_permission table
- Deletes 44 Pentaho report entries from stretchy_report table
- Handles child table (stretchy_report_parameter) before parent deletion
- Uses case-insensitive matching for cross-database compatibility
The migration includes preConditions to safely handle cases where
Pentaho data has already been removed, ensuring idempotent execution.
---
.../db/changelog/tenant/changelog-tenant.xml | 1 +
.../parts/0210_remove_pentaho_reports.xml | 149 ++++++++++++++++++
2 files changed, 150 insertions(+)
create mode 100644 fineract-provider/src/main/resources/db/changelog/tenant/parts/0210_remove_pentaho_reports.xml
diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
index 34da1913f50..24ad6a95dba 100644
--- a/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
+++ b/fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
@@ -228,4 +228,5 @@
+
diff --git a/fineract-provider/src/main/resources/db/changelog/tenant/parts/0210_remove_pentaho_reports.xml b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0210_remove_pentaho_reports.xml
new file mode 100644
index 00000000000..0034009d6df
--- /dev/null
+++ b/fineract-provider/src/main/resources/db/changelog/tenant/parts/0210_remove_pentaho_reports.xml
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+ SELECT COUNT(*) > 0
+ FROM m_role_permission rp
+ JOIN m_permission p ON p.id = rp.permission_id
+ WHERE LOWER(p.code) LIKE LOWER('%Pentaho%')
+
+
+ Remove role permissions for deprecated Pentaho reports
+
+ DELETE FROM m_role_permission
+ WHERE permission_id IN (SELECT id FROM m_permission WHERE LOWER(code) LIKE LOWER('%Pentaho%'));
+
+
+
+
+
+ SELECT COUNT(*) > 0 FROM m_permission WHERE LOWER(code) LIKE LOWER('%Pentaho%')
+
+
+ Remove deprecated Pentaho report permissions
+
+ DELETE FROM m_permission WHERE code IN (
+ 'READ_Active Loans - Summary(Pentaho)',
+ 'READ_Active Loans by Disbursal Period(Pentaho)',
+ 'READ_Active Loans in last installment Summary(Pentaho)',
+ 'READ_Active Loans in last installment(Pentaho)',
+ 'READ_Active Loans Passed Final Maturity Summary(Pentaho)',
+ 'READ_Active Loans Passed Final Maturity(Pentaho)',
+ 'READ_Aging Detail(Pentaho)',
+ 'READ_Aging Summary (Arrears in Months)(Pentaho)',
+ 'READ_Aging Summary (Arrears in Weeks)(Pentaho)',
+ 'READ_Client Listing(Pentaho)',
+ 'READ_Client Loans Listing(Pentaho)',
+ 'READ_Expected Payments By Date - Basic(Pentaho)',
+ 'READ_Funds Disbursed Between Dates Summary by Office(Pentaho)',
+ 'READ_Funds Disbursed Between Dates Summary(Pentaho)',
+ 'READ_Loans Awaiting Disbursal Summary by Month(Pentaho)',
+ 'READ_Loans Awaiting Disbursal Summary(Pentaho)',
+ 'READ_Loans Awaiting Disbursal(Pentaho)',
+ 'READ_Loans Pending Approval(Pentaho)',
+ 'READ_Obligation Met Loans Details(Pentaho)',
+ 'READ_Obligation Met Loans Summary(Pentaho)',
+ 'READ_Portfolio at Risk by Branch(Pentaho)',
+ 'READ_Portfolio at Risk(Pentaho)',
+ 'READ_Rescheduled Loans(Pentaho)',
+ 'READ_TxnRunningBalances(Pentaho)',
+ 'READ_Written-Off Loans(Pentaho)',
+ 'READ_Staff Assignment History'
+ );
+
+
+
+
+
+ SELECT COUNT(*) > 0
+ FROM stretchy_report_parameter
+ WHERE report_id IN (SELECT id FROM stretchy_report WHERE LOWER(report_type) = LOWER('Pentaho'))
+
+
+ Remove parameters for deprecated Pentaho reports
+
+ DELETE FROM stretchy_report_parameter
+ WHERE report_id IN (SELECT id FROM stretchy_report WHERE LOWER(report_type) = LOWER('Pentaho'));
+
+
+
+
+
+ SELECT COUNT(*) > 0 FROM stretchy_report WHERE LOWER(report_type) = LOWER('Pentaho')
+
+
+ Remove deprecated Pentaho reports from stretchy_report
+
+ DELETE FROM stretchy_report WHERE report_name IN (
+ 'Balance Sheet',
+ 'Income Statement',
+ 'Trial Balance',
+ 'Loan Account Schedule',
+ 'Branch Expected Cash Flow',
+ 'Expected Payments By Date - Formatted',
+ 'Savings Transactions',
+ 'Client Savings Summary',
+ 'Active Loans - Details(Pentaho)',
+ 'Active Loans - Summary(Pentaho)',
+ 'Active Loans by Disbursal Period(Pentaho)',
+ 'Active Loans in last installment Summary(Pentaho)',
+ 'Active Loans in last installment(Pentaho)',
+ 'Active Loans Passed Final Maturity Summary(Pentaho)',
+ 'Active Loans Passed Final Maturity(Pentaho)',
+ 'Aging Detail(Pentaho)',
+ 'Aging Summary (Arrears in Months)(Pentaho)',
+ 'Aging Summary (Arrears in Weeks)(Pentaho)',
+ 'Client Listing(Pentaho)',
+ 'Client Loans Listing(Pentaho)',
+ 'Expected Payments By Date - Basic(Pentaho)',
+ 'Funds Disbursed Between Dates Summary by Office(Pentaho)',
+ 'Funds Disbursed Between Dates Summary(Pentaho)',
+ 'Loans Awaiting Disbursal Summary by Month(Pentaho)',
+ 'Loans Awaiting Disbursal Summary(Pentaho)',
+ 'Loans Awaiting Disbursal(Pentaho)',
+ 'Loans Pending Approval(Pentaho)',
+ 'Obligation Met Loans Details(Pentaho)',
+ 'Obligation Met Loans Summary(Pentaho)',
+ 'Portfolio at Risk by Branch(Pentaho)',
+ 'Portfolio at Risk(Pentaho)',
+ 'Rescheduled Loans(Pentaho)',
+ 'TxnRunningBalances(Pentaho)',
+ 'Written-Off Loans(Pentaho)',
+ 'Client Saving Transactions',
+ 'Client Loan Account Schedule',
+ 'Savings Transaction Receipt',
+ 'Loan Transaction Receipt',
+ 'Staff Assignment History',
+ 'GeneralLedgerReport',
+ 'Active Loan Summary per Branch',
+ 'Balance Outstanding',
+ 'Collection Report',
+ 'Disbursal Report'
+ ) AND LOWER(report_type) = LOWER('Pentaho');
+
+
+