Skip to content

Invalid migration export for empty database #32535

Closed

Description

@ps-gill

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

core

Describe the bug

Using the Setting JPA provider configuration option for migrationStrategy docs, generated a migration export with an empty database. The resulting SQL script contained duplicate CREATE TABLE statements for databasechangelog tables.

I removed the duplicate statement and used it to create a schema. Afterwards, started up keycloak with migrationStrategy set to validate. The database user, for keycloak, didn't have any DDL privileges. At startup, it tried to create databasechangeloglock tables, for which there wasn't a CREATE TABLE statement in the migration export. Keycloak failed to started due to the lack of DDL privileges.

Database: PostgreSQL 14
KC_DB_SCHEMA set to a non-public schema.

Looking at this part of migration export,

loggingExecutor.execute(new CreateDatabaseChangeLogTableStatement());
, shouldn't it create loglock table instead of log table?

Version

25.0.4

Regression

  • The issue is a regression

Expected behavior

The migration export should have CREATE TABLE statement for databasechangeloglock table.

Actual behavior

The migration export contains duplicate CREATE TABLE statement for databasechangelog table.

How to Reproduce?

Follow the steps mentioned under description.

Anything else?

No

Activity

  1. added
    kind/bug
    on Aug 30, 2024
  2. added
    area/core
    on Aug 30, 2024
  3. modified the milestones: , 26.1.0 on Oct 3, 2024
  4. 14 remaining items

  5. added a commit that references this issue on Feb 11, 2025
    06a85ad
  6. added a commit that references this issue on Feb 11, 2025
    fe40730
  7. added a commit that references this issue on Feb 11, 2025
    c5a7155
  8. added a commit that references this issue on Feb 11, 2025
    31c8b02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/corekind/bugpriority/importantrelease/26.0.10release/26.1.3release/26.2.0team/cloud-native

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions