Skip to content

FINERACT-2595: Fix Liquibase changeset 0231 FK violation on existing tenants#5805

Merged
IOhacker merged 1 commit intoapache:developfrom
AshharAhmadKhan:FINERACT-2595-fix-liquibase-fk-clientcharge-permissions
Apr 24, 2026
Merged

FINERACT-2595: Fix Liquibase changeset 0231 FK violation on existing tenants#5805
IOhacker merged 1 commit intoapache:developfrom
AshharAhmadKhan:FINERACT-2595-fix-liquibase-fk-clientcharge-permissions

Conversation

@AshharAhmadKhan
Copy link
Copy Markdown
Contributor

Problem

Changeset 0231 (merged in #5764) failed on existing tenants with a
PostgreSQL foreign key violation:

DELETE FROM m_permission WHERE code='INACTIVATE_CLIENTCHARGE'
→ ERROR: violates foreign key constraint "fk8dedb048103b544b"
on table "m_role_permission"

This happened because m_role_permission holds references to m_permission
via a foreign key. You cannot delete a permission row while role-permission
rows still point to it.

Additionally, the changeset author was set to "ashharahmadkhan" instead
of the required "fineract".

Fix

  1. Delete orphaned m_role_permission rows first, before deleting the
    parent m_permission rows.
  2. Change changeset author from "ashharahmadkhan" to "fineract".

Fresh tenants (barebones_db / load_sample_data) were unaffected because
those permissions were never assigned to any role. Existing tenants with
roles assigned to INACTIVATE_CLIENTCHARGE hit the FK violation on startup.

References

…n rows before m_permission to avoid FK violation, change author to fineract
@AshharAhmadKhan
Copy link
Copy Markdown
Contributor Author

Hi @IOhacker, this should fix both issues you reported. Please have a look at this when you get a chance.

@IOhacker
Copy link
Copy Markdown
Contributor

@AshharAhmadKhan thank you!, looks ok, let's wait for the completition of the GAs .

Copy link
Copy Markdown
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IOhacker IOhacker merged commit 21ca05f into apache:develop Apr 24, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants