Skip to content

Commit 6293e50

Browse files
FINERACT-2481: Remove Pentaho reports from initial sample data
Removes deprecated Pentaho report entries from both sample data and existing installations. Changes: - Added Liquibase migration 0210_remove_pentaho_reports.xml * Deletes 26 Pentaho permission entries from m_permission table * Deletes 44 Pentaho report entries from stretchy_report table - Updated sample data files (barebones_db.sql and load_sample_data.sql) * Prevents new installations from including legacy Pentaho reports The Liquibase migration ensures existing installations are cleaned up, while the sample data changes prevent new installations from including these entries. The Pentaho reporting framework is being deprecated in favor of modern reporting solutions. Fix: Delete child records before parent in Pentaho removal migration - Add changeset to delete m_role_permission entries first - Prevents FK constraint violation FK8DEDB048103B544B on MariaDB/MySQL - Maintains deletion order: role_permissions -> permissions -> reports - Fixes test-core-1 failures on MariaDB and MySQL - Tested locally: all 919 provider tests pass with MySQL
1 parent 6269cbb commit 6293e50

File tree

4 files changed

+60
-140
lines changed

4 files changed

+60
-140
lines changed

fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,5 @@
228228
<include file="parts/0207_add_allow_full_term_for_tranche.xml" relativeToChangelogFile="true" />
229229
<include file="parts/0208_trial_balance_summary_with_asset_owner_journal_entry_aggregation_fix.xml" relativeToChangelogFile="true" />
230230
<include file="parts/0209_transaction_summary_with_asset_owner_and_from_asset_owner_id_for_asset_sales.xml" relativeToChangelogFile="true" />
231+
<include file="parts/0210_remove_pentaho_reports.xml" relativeToChangelogFile="true" />
231232
</databaseChangeLog>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
22+
<!-- Step 1: Delete child records from m_role_permission first -->
23+
<changeSet author="fineract" id="1">
24+
<preConditions onFail="MARK_RAN">
25+
<sqlCheck expectedResult="1">
26+
SELECT COUNT(*) > 0
27+
FROM m_role_permission rp
28+
JOIN m_permission p ON p.id = rp.permission_id
29+
WHERE p.code LIKE '%Pentaho%'
30+
</sqlCheck>
31+
</preConditions>
32+
<comment>Remove role permissions referencing deprecated Pentaho report permissions</comment>
33+
<delete tableName="m_role_permission">
34+
<where>permission_id IN (SELECT id FROM m_permission WHERE code LIKE '%Pentaho%')</where>
35+
</delete>
36+
</changeSet>
37+
38+
<!-- Step 2: Delete parent records from m_permission -->
39+
<changeSet author="fineract" id="2">
40+
<preConditions onFail="MARK_RAN">
41+
<sqlCheck expectedResult="1">SELECT COUNT(*) > 0 FROM m_permission WHERE code LIKE '%Pentaho%'</sqlCheck>
42+
</preConditions>
43+
<comment>Remove deprecated Pentaho report permissions</comment>
44+
<delete tableName="m_permission">
45+
<where>code LIKE '%Pentaho%'</where>
46+
</delete>
47+
</changeSet>
48+
49+
<!-- Step 3: Delete Pentaho reports from stretchy_report -->
50+
<changeSet author="fineract" id="3">
51+
<preConditions onFail="MARK_RAN">
52+
<sqlCheck expectedResult="1">SELECT COUNT(*) > 0 FROM stretchy_report WHERE report_name LIKE '%Pentaho%'</sqlCheck>
53+
</preConditions>
54+
<comment>Remove deprecated Pentaho reports from stretchy_report table</comment>
55+
<delete tableName="stretchy_report">
56+
<where>report_name LIKE '%Pentaho%'</where>
57+
</delete>
58+
</changeSet>
59+
</databaseChangeLog>

0 commit comments

Comments
 (0)