🚧 Fix bootstrap bug

This commit is contained in:
Andreas Dinauer 2026-04-18 23:07:07 +02:00
parent a210b05661
commit 664e4243ef
3 changed files with 12 additions and 8 deletions

View File

@ -109,6 +109,13 @@
<build>
<plugins>
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<configuration>
<enableLazyInitialization>true</enableLazyInitialization>
</configuration>
</plugin>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>

View File

@ -30,6 +30,7 @@ public class RealmBootstrapService
@Inject
AudienceStrategyRepo audienceStrategyRepo;
@Inject
RoleBootstrapper roleBootstrapper;
@ -45,10 +46,10 @@ public class RealmBootstrapService
public RealmEntity run(String key, Realm realm)
{
Optional<RealmEntity> existingRealm = realmRepo.findByIdOptional(key);
if (existingRealm.isPresent())
RealmEntity existingRealm = realmRepo.findByKey(key);
if (existingRealm != null)
{
return existingRealm.get();
return existingRealm;
}
else
{

View File

@ -1,5 +1,3 @@
quarkus.jvm-args=--add-opens java.base/java.lang=ALL-UNNAMED
quarkus.http.root-path=/api
quarkus.http.test-port=9089
quarkus.http.host=0.0.0.0
@ -12,8 +10,6 @@ quarkus.http.cors.enabled=true
# Postgres
prod.quarkus.hibernate-orm.validate-in-dev-mode=false
quarkus.hibernate-orm.schema-management.strategy=none
%test,dev.quarkus.hibernate-orm.schema-management.strategy=none
quarkus.datasource.db-kind=postgresql
%dev,test.quarkus.datasource.username=postgres
@ -21,7 +17,7 @@ quarkus.datasource.db-kind=postgresql
%dev,test.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=auth
# Flyway
%dev,test.quarkus.flyway.clean-at-start=true
%dev,test.quarkus.flyway.clean-at-start=false
%dev.quarkus.flyway.locations=db/migration,db/dev
quarkus.flyway.migrate-at-start=true