From ae54fa8dd2e41b4ff2d0a0c0211f2d0ab55205fe Mon Sep 17 00:00:00 2001 From: psytester Date: Fri, 26 Aug 2022 10:38:41 +0200 Subject: [PATCH] JPA spi example added (#11110) * JPA spi example added Added: how to configure JPA migration * Update db.adoc * Update configuration-provider.adoc moved JPA config to db.adoc * Update docs/guides/src/main/server/configuration-provider.adoc Co-authored-by: Stian Thorgersen --- docs/guides/src/main/server/db.adoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/guides/src/main/server/db.adoc b/docs/guides/src/main/server/db.adoc index abacd3271a6..97ee27144d6 100644 --- a/docs/guides/src/main/server/db.adoc +++ b/docs/guides/src/main/server/db.adoc @@ -136,4 +136,21 @@ Keycloak uses XA transactions and the appropriate database drivers by default. C Keycloak automatically chooses the appropriate JDBC driver for your vendor. +== Setting JPA provider configuration option for migrationStrategy + +To setup the JPA migrationStrategy (manual/update/validate) you should setup JPA provider as follows: + +.Setting the `migration-strategy` for the `quarkus` provider of the `connections-jpa` SPI +<@kc.start parameters="--spi-connections-jpa-quarkus-migration-strategy=manual"/> + +If you want to get a SQL file for DB initialization, too, you have to add this additional SPI initializeEmpty (true/false): + +.Setting the `initialize-empty` for the `quarkus` provider of the `connections-jpa` SPI +<@kc.start parameters="--spi-connections-jpa-quarkus-initialize-empty=false"/> + +In the same way the migrationExport to point to a specific file and location: + +.Setting the `migration-export` for the `quarkus` provider of the `connections-jpa` SPI +<@kc.start parameters="--spi-connections-jpa-quarkus-migration-export=/"/> +