Skip to content

Conversation

xyraclius
Copy link
Contributor

@xyraclius xyraclius commented Sep 23, 2025

🚀 Overview

This PR fixes the /actuator/liquibase endpoint to respect the spring.liquibase.liquibase-schema property. Previously, the endpoint always used default-schema, even when liquibase-schema was configured.


🔥 Motivation

When application tables and Liquibase’s internal tables use separate schemas, the /actuator/liquibase endpoint ignores liquibase-schema and only reports changes from default-schema. This results in misleading output and prevents accurate monitoring of Liquibase change sets.


🔧 Changes

  • Updated LiquibaseEndpoint.createReport to:
    • Use liquibase.getLiquibaseSchema() when configured.
    • Fall back to liquibase.getDefaultSchema() otherwise.
  • Applied database.setDefaultSchemaName(schemaToUse) only when a schema is present.
  • Added unit test invokeWithLiquibaseSchema() to verify correct behavior.

✅ Benefits

  • /actuator/liquibase now produces accurate reports when spring.liquibase.liquibase-schema is configured.
  • Supports schema separation between Liquibase internal tables and application domain tables.
  • Backward compatible — existing setups that rely on default-schema remain unaffected.

🔖 Related Issue

Closes #47290

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 23, 2025
Closes spring-projectsgh-47290

Signed-off-by: Nabil Fawwaz Elqayyim <master@nabilfawwaz.com>
@wilkinsona wilkinsona changed the title Fix LiquibaseEndpoint to use liquibase-schema when configured LiquibaseEndpoint always uses defaultSchema instead of liquibaseSchema Sep 26, 2025
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 26, 2025
@wilkinsona wilkinsona added this to the 3.4.x milestone Sep 26, 2025
@snicoll snicoll self-assigned this Sep 29, 2025
@snicoll snicoll modified the milestones: 3.4.x, 3.4.11 Sep 29, 2025
snicoll pushed a commit that referenced this pull request Sep 29, 2025
See gh-47300

Signed-off-by: Nabil Fawwaz Elqayyim <master@nabilfawwaz.com>
@snicoll snicoll closed this in e8b6ab1 Sep 29, 2025
@snicoll
Copy link
Member

snicoll commented Sep 29, 2025

Thanks @xyraclius!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LiquibaseEndpoint always uses defaultSchema instead of liquibaseSchema
4 participants