My goal is to keep my application tables and keycloak tables under one database. When I am giving this database details in keycloak deployment, it starts creating the tables but it fails with following error and pod gets stopped. But same is working with the fresh database container.
Following is part of error gets occured -
17:07:41,199 ERROR [org.keycloak.connections.jpa.updater.liquibase.conn.DefaultLiquibaseConnectionProvider] (ServerService Thread Pool – 63) Change Set META-INF/jpa-changelog-3.2.0.xml::3.2.0-fixed::keycloak failed. Error: ERROR: column “docker_auth_flow” of relation “realm” already exists [Failed SQL: ALTER TABLE public.REALM ADD DOCKER_AUTH_FLOW VARCHAR(36)]
17:07:41,200 ERROR [org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider] (ServerService Thread Pool – 63) Error has occurred while updating the database: liquibase.exception.MigrationFailedException: Migration failed for change set META-INF/jpa-changelog-3.2.0.xml::3.2.0-fixed::keycloak:
Reason: liquibase.exception.DatabaseException: ERROR: column “docker_auth_flow” of relation “realm” already exists [Failed SQL: ALTER TABLE public.REALM ADD DOCKER_AUTH_FLOW VARCHAR(36)]
at org.liquibase//liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
at org.liquibase//liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
at org.liquibase//liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
at org.liquibase//liquibase.Liquibase.update(Liquibase.java:214)
at org.liquibase//liquibase.Liquibase.update(Liquibase.java:192)
at org.liquibase//liquibase.Liquibase.update(Liquibase.java:188)
at org.keycloak.keycloak-model-jpa@16.1.1//org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.updateChangeSet(LiquibaseJpaUpdaterProvider.java:184)