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 <stian@redhat.com>
This commit is contained in:
psytester 2022-08-26 10:38:41 +02:00 committed by GitHub
parent ac6ee54455
commit ae54fa8dd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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. 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=<path>/<file.sql>"/>
</@tmpl.guide> </@tmpl.guide>