MX-136: Liquibase migration to safely remove unreferenced Pentaho reports#434
Merged
IOhacker merged 3 commits intoopenMF:developfrom Mar 3, 2026
Merged
Conversation
…migration Adds a Liquibase migration under db/custom-changelog to remove report_type = 'Pentaho' entries from stretchy_report that are not referenced by mailing jobs or campaigns. Implementation details: - Deletes only unreferenced Pentaho reports (Option A behavior) - Preserves m_report_mailing_job and m_report_mailing_job_run_history - Uses NOT EXISTS checks for FK-safe deletion - Cross-database compatible (MariaDB & PostgreSQL) - Idempotent and safe on restart - Does not modify Apache Fineract core Tested against Fineract 1.15.0-SNAPSHOT (develop) with MariaDB 11.4.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Liquibase custom changelog to remove deprecated report_type = 'Pentaho' rows from stretchy_report when they are not referenced by jobs/campaigns, keeping historical run data intact.
Changes:
- Introduces a new Liquibase changeSet to delete unreferenced Pentaho reports from
stretchy_report. - Adds preconditions to gate execution based on presence of related reference tables.
- Documents the intended destructive nature of the cleanup (no rollback).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/resources/db/custom-changelog/remove-pentaho-reports.xml
Outdated
Show resolved
Hide resolved
Kindly see my comments Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
IOhacker
requested changes
Mar 3, 2026
src/main/resources/db/custom-changelog/remove-pentaho-reports.xml
Outdated
Show resolved
Hide resolved
Contributor
|
@raghavvag please remove the Copilot suggestion, it was applied by me. |
Contributor
|
I have just one comment regarding the author |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements MX-136 by introducing a Liquibase migration in the Mifos Reporting Plugin to remove deprecated Pentaho report definitions from the
stretchy_reporttable.The migration deletes only unreferenced Pentaho reports and preserves all historical data and FK integrity.
This follows the agreed Option A behavior:
report_type = 'Pentaho'entries fromstretchy_reportm_report_mailing_job_run_historyImplementation Details
Migration File
db/custom-changelog/remove-pentaho-reports.xmlchangeSet
mx136-remove-pentaho-unreferenced-reportsraghavcustom_changelogDeletion Strategy
The migration deletes Pentaho reports only when ALL of the following are true:
report_type = 'Pentaho'm_report_mailing_jobscheduled_email_campaignsms_campaignThe SQL uses ANSI-compliant
NOT EXISTSchecks to ensure:No DELETE alias syntax is used to avoid MariaDB incompatibility.
Safety Guarantees
Testing Performed
Tested On
Phase 1 — Baseline Validation
Phase 2 — Liquibase Execution Verification
DATABASECHANGELOGPhase 3 — Post-Migration Validation
All 44 unreferenced Pentaho reports were deleted.
No collateral impact observed.
Phase 4 — Validation (Skip Referenced)
Test Scenario
Results
Confirmed skip logic works as intended.
Phase 5 — Idempotency
DATABASECHANGELOGPhase 6 — Cross-Database Safety
The SQL is compatible with PostgreSQL.
Final Result
Impact
This migration safely removes deprecated Pentaho metadata while preserving historical data and system integrity.
Fully aligned with MX-136 requirements.
Ready for review.